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.
Please use spoiler flag.
This comment is hidden because it contains spoiler information about the solution
Never a need to double-sort - just return a tuple from the key lambda.
cmp
has been deprecated for a very long time - very bad practice to use it.Any stack overflow can be addressed with memoization - by storing previous answers, you limit the depth of recursion. Keep in mind that you very well may need to prime the pump.
A follow-on kata that has more involved rules for scoring, perhaps including runs as well as sets, would be more worthy of 5 kyu. I think this kata is more of a 7 kyu.