Ad
  • Custom User Avatar

    O(n) should be clever or best practice. Not this! This is awful solution.

  • Custom User Avatar

    You're perfectly correct. I didn't anticipate that approach when I designed the test cases, I'm afraid, and since the kata is published, I can't change or add them now.

    The chance of a random test case catching those solution is also rather small, unfortunately.

    From another perspetive, they actually solve the problem as stated in the description, even if that was not my intention. :-)

    Thanks for the feedback. :-)

    (You have a tight and readable solution, too, btw. Nice!)