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.
In the java version of this kata the main function has int as an input instead of int[].
I would suggest that it gets changed as it is annoyingly easy to miss.
It would be two because two is the default case in the ternary operator.
This comment is hidden because it contains spoiler information about the solution
Fixed except random tests. I tried to find a good way of implementing it but it would be rather difficult without putting a solution in the test class. Do you have a good idea of how to implement random tests in this particulur case and it would be most appreciated.
Thanks! Appreciate that you took the time to comment :)
I fixed the code so that it has random cases. Thank you for pointing it out!
This comment is hidden because it contains spoiler information about the solution
How well does C++ handle recursive functions vs iteration? In java there is a stack overflow if the program's recursion goes too deep. Does a similar thing happen to C++ programs?
It's correct but it doesn't make you understand how to it works.
Even though it isn't correct, it is quite a funny hack ;)