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 really like the dictonary for the final result.
TIL
I have brute forced my wait into a solution by doing performance analysis and thinking of clever ways to reduce the calculations which you have also done.
(Side note, when doing performance analysis/debugging I noticed that I had bug on my optimizations which you could also double check)
Still, there are generic ways to improve performance of any algorithm which you could try.
The hardest parts seem to (0) understand the problem in a meaningful way, (1) to optimize the solution so long that it passes all tests without timeout.
This seriousTests case is killing me. I can't figure out how to optimize my solution enough to pass.
I've got the obvious case of m <= n covered to knock out half the calculations.
I've also got m - n == 1, m -n ==2 and m = 2n + 1 to knock out more calculations but I cannot figure out how to reduce the calculations when m is much greater than n.
Can someone give me a hint?