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.
I'm going to give you a few general hints, which applies to ALL problem solving challenges like this.
"Start with the extremes": Instead of starting for a generic N, maybe start with 1.
If you havent already, try getting out a pen and paper, and workout a few examples, and try and spot a pattern. Also, you are tasked to find the value for f(n), so try to be deliberate on this "intermidiate" value. Keep this in your mind, when looking for patterns.
Anymore than this, unfortunately will give away too much, and I don’t want to rob you of the satisfaction when you finally solve this!
You are so nice. It tooke me a while to figure out the logic of the task. This is why I've stayed with a loop instead of a one-linear based on 'reduce'.
well spotted, fixed
I can't find these words anywhere in the description. Could you be more specific?
Thanks for informing me, That's certainly not an accurate implementation for passing all possible tests, I applied a different answer considering this problem.