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.
Your keys might have changed. If the original arrays is
0 => 0
1 => 2
2 => 2
3 => 0
and your array is
0 => 2
1 => 2
4 => 0
5 => 0
the test will expect to see an array with the same values but 0, 1, 2, 3, keys
yes, my first time completing a 4 kyu kata:)
just got a little excited when i saw that the code actually worked.
I'll probably refactor it later
Thanks anyways
This comment is hidden because it contains spoiler information about the solution
Overly complicated recursive solution, i'm not even sure how and why this works tbh, especially the end of my for loop.
If else:
continue
is not present the solution doesn't work, i'm also not sure what res does exactly...
At this point my head hurts, if someone can explain this to me i'd appreciate it.
Is it possible to improve performance by caching some of the recusive function calls results ? functools.lru_cache() doesn't work because 1 digit matrixes are not hashable.
My solution works, but takes up to 9 seconds to resolve the tests, and none of the test go higher than a 8 digit matrix iirc