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.
Well, you can use memoization on this kata (Not the linear version though), so DP is a valid tag.
I guess I can add the mathematics tag to the kata.
Edit: Done
You can make it with DP if you're observant enough and make enough tables to look at. (That's how I initially solved this kata. Though OEIS and other previous experiences of sequences also helped.)
The more performance heavy linear version, though, actually requires mathematics.
I found same solution after a long time. I think the label "DYNAMIC PROGRAMMING" is kind of confusing.
All the solutions in python are the same way.
maybe the label "math" or something else is better?
I think the label "DYNAMIC PROGRAMMING" is improper. I can't make it with DP.
In fact I think it is more like a math problem.
I don't know whether the reason is that I use python so I can't make it with DP.