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.
Yup, easy to understand but far slower than a simple loop in this case, particularly because of the function chaining.
This solution is too slow and probably times out. Values of r in excess of 1 million are used in tests. Modifying the original array will not work. Need to figure the array index for any given r. I solved it by writing out the results for R from 1 to 35 and looking at the sequence. It has something to do with powers of 2.
Nice kata for better understanding about an Object!! thanks !!
This comment is hidden because it contains spoiler information about the solution
The code is really easy to understand! I always forgot to use the recursive anyway :(