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.
Seems you misunderstood somehting because the while loops do execute themselves. Hint: this code is calculating the sum of fatorial(n) for n = 1 to 5 and so should output 153 (as you already know).
haha, just for fun. I haven't practiced lookup table a long time. If i's range was limited, lookup table is the one of fast solutions, like lookup the ticket price between 2 train stations.
Your code surely will find the correct
number
sometimes, but your code can not return the expected number.When execute the if statement, meet
==0
, then recursive +1, but please note:AvoidObstacles(.....)
has noreturn
keyword with it, it just execute, no result. I'm think so ;-)EDIT: you code does not check the last element of array(
i=1;i<...length...[i-1]
).Is it OK now?
No worries I forgot to change it last night when I did the translation. Thanks for being the first to point it out so I could change it.
Thanks I just changed the initial solution.