Ad
  • Custom User Avatar

    I really like the dictonary for the final result.

  • Custom User Avatar
  • Custom User Avatar

    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.

  • Default User Avatar

    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.

  • Custom User Avatar

    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?