Ad
  • Custom User Avatar

    Quite right. I never used this before but it works like a charm.

  • Custom User Avatar

    Brilliant Kata and it was great fun to solve it. But were the >2500 random tests really necessary? It posed quite an additional challenge on the performance of the algorithm. I know, it's 3kyu, but getting the tree right is already a puzzle without the added complication of scarce time.

  • Custom User Avatar

    When that happens, it may help to put a print-statement in your function. Just print the input before doing anything. So, you can see the random cases in the test output and find out what went wrong.
    You can also print intermediary results, as you would do while debugging a function that behaves strangely.

  • Custom User Avatar

    To all those who passed this Kata: How long did it take you to get the algorithm working to specifications? It took me days and I had to start from scratch four times. And when it finally worked, it kept timing out and I had to optimize it in many ways.
    Since I usually consider myself a proficient programmer, I can't believe how difficult it was to get this (finally) simple algorithm working.

    Can you relate?

  • Custom User Avatar

    Yes, it was not hard once I printed the test values to the console and saw the problem. But In the details, there was a comment about "no traps". Changing the format is kind of a trap ;)
    If you use "," from the beginning, it's no problem. R is quite flexible in recognizing integers with leading blanks. But if you use ", ", the random tests raise errors.
    But It's a really small issue. Thanks for resolving.

  • Custom User Avatar

    The random tests use a different format than the basic tests. There is no blank after the comma, which prevents the strsplit() from working if the delimiter ", " is used.

  • Custom User Avatar

    The Python test syntax in main.py uses the 'print ""' expression instead of 'print("")', even if the Kata is solved in Python 3.x. So, it raises a syntax error. Please revise.
    (If left as is, the kata may only be solved in Python 2.7. Any 3.x specific functions are impossible)