Ad
  • Custom User Avatar

    Seems so;

    If it passes the cases till timeout then it is right.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    It does locally in ~30ms. I'm timing out after ~830 tests.

    After attempting it in python, my solution works with over 5 seconds to spare. You may want to reduce the number of tests for Javascript.

  • Custom User Avatar

    There are 1640 tests in javascript and ~450 in python.

    Just make sure your solution can get 2**49th item; if it does then it will definitely pass random tests too :)

  • Custom User Avatar

    I'm really enjoying this kata so far.
    I've made it through 830 tests, but I see that you meantioned it was ~450 in total. Is there an issue with there being too many tests or otherwise?
    Also, I think I've gone the one step deeper you suggested, maybe there is a more efficient way that I'm not getting to (that is still relatively brute force)? I'm not really looking for hints, I just don't know if I've met the expectation yet or not

    *Edit: After returning at the top of the function call, I'm getting over 1600 tests, and its taking over 6 seconds just to call and return the function. I figure it is too many tests.