Ad
  • Default User Avatar

    Heh - I forgot the trick where if you set a default value in the function signature, the instance persists.

    Thanks for the pointer

  • Custom User Avatar

    How big are the numbers you are testing locally? In the tests inputs go up to 1000. When I run your memoized function (after manually increasing the recursion limit), it takes a good 20 seconds or so. You need a better algorithm (Hint: memoize results between function calls too, not just for a single function call)

  • Default User Avatar

    Note: Using Python

    Testing my algorithm offline, I can complete a 100000 test run in 1.15 seconds. In the codewars environment, this times out after 12 seconds, meaning that I cannot submit my solution.

    Annoying...