+ 1

Cool use of recursion, but need to be careful.

The way these tests are, will go infinite if not a non-negative integer. Luckily it looks like SoloLearn will stop if it seems to be taking too long. I'm not sure about other Python interpreters.

1st Nov 2018, 2:18 PM
David Scott
David Scott - avatar
1 Odpowiedź
+ 3
That's indeed correct. It seems like SoloLearn times out over time based on the server information. Careful though, for web codes such as JS recursion will go on infinitely and make you have to restart SoloLearn.
1st Nov 2018, 3:02 PM
Andre Daniel
Andre Daniel - avatar