Ad
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    The test cases should include empty strings and single character strings (my solution is incorrect for single character inputs, put the test does not catch it).

  • Custom User Avatar

    The problem should be re-worded:

    "Take every 2nd char" is not correct English. What it (supposedly) means is "take every other char".

    In my opinion, a better wording would be:

    "Take the characters from the even positions in the input (if any), followed by the remaining characters (at the odd positions)."

    That is unambiguous and correctly states the problem.

  • Custom User Avatar

    You can make a tail recursive solution which does not run into problems even with a large number of iterations. I've tested my solution with 1 million iterations and it works.

    So that's definitely possible.

    In my opinion, if your solution fails for large values of "n", then it's not correct :).

  • Custom User Avatar

    It's hard for everybody, because the problem is not well-specified.

    "Take every 2nd char" is NOT good English -- instead, it should read "take every OTHER char".

    (In fact, if taken literally, the wording would mean to output the "2nd char" only, because there is only one "2nd char" in the input; of course that's silly and nobody reads it that way.)

    The author of this Kata presumably speaks German (going from his name), and in German the phrase is "take every 2nd char". So it's German translated into bad English.

    Also, the problem is not clear about which character to output first; of course this can be inferred from the examples, but the problem text should be clear about this in the first place.

    Please fix the wording!