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.
Is not tail rec (can go on stackoverflow) and moreover Java does not support tail rec optimization.
If you really want to go with rec mode you should use an accumulator.
Yep. The code will indeed go into an infinite recursion if n is less than 1 (negative number or 0), resulting in a stack overflow error.
Doesn't this go into an infinite loop if I put in ) or any negative number?
if n == 0 then we call 0 + triangular(-1) and so on and so forth.
Thanks!
It should have "arrays" instead of "strings" on its tags.
Doesn't work for negative input!