Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Quite right. I never used this before but it works like a charm.
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.
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.
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?
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.
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.
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)