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.
Можно, но временыые затраты на выполнение кода значительно выше.
It might be a nice modification to this question to ask for the value on the nth day, then have a test that runs out of memory if you keep all of both lists in memory.
You don't need recursion.
I did this in Python and first tried to avoid defining new functions and do it recursively, but even if my code completed the sample tests I couldn´t pass when attempting the full tests. My question is if this could have been completed recursively, since I couldn´t find a way to avoid recalculating every day for john and ann in each recursion which obviously made my code time out when attempting the full set of tests.