Ad
  • Custom User Avatar

    ;-)

  • Custom User Avatar

    That feeling when you catch the one elusive bug and solve the puzzle

    It's not so much that the kata had far fewer tests, it's that the given translation was authored by someone else. Looks like you completed this in C++; I didn't enforce any fixed number of tests for the C++ (or Java) translation but I trust the authors' judgment for their respective languages.

  • Custom User Avatar

    After further testing, I had some cases that were infinite looping. I got them fixed and now I passed in about 2 seconds.

    After all the work I'd put in, I was getting pretty frustrated :)

  • Custom User Avatar

    The optimization requirement is not really tight. If you can run 500 puzzles in under a second, your solution should be fine.

    Have you printed too much stuff to stdout? Because that's known to cause problems.

  • Custom User Avatar

    My solution finishes 500 puzzles of various sizes in 800ms on my own computer, and yet somehow times out on this one during the random tests. My solution is algorithmic rather than using trees etc, and so should be shorter than some who built crawlers. I can't understand why codewars would be timing out on my solution.

    Also, why does a solution have to solve 400 random puzzles ontop of a set of 12 fixed ones? isn't that a bit extreme? If there are some ridiculous optimization requirements they should be posted in the instructions, or at least the kata should be tagged "optimization".

    Otherwise people are going to validate their solutions and get nicked losing their chance at a first time pass just because they didn't divine the unspecified requirements.

    I'm feeling a bit jealous reading the discussion and seeing that this puzzle used to have far fewer tests.