Ad
  • Default User Avatar

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

  • 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.

  • Custom User Avatar

    This is the list of first 50 elements;

    li = [0, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13]
    li[46] == 13

  • Default User Avatar

    Hi warriors,

    I need your support. I'm a little bit lost, or I understood this kata wrong. When sending my solution it passed all tests, but when I attemp it doesn't work. For example with n = 46 my code responses with 12 as solution, but the test claims it is wrong and requires 13 as result.

    I tried it with pen and paper and counted by hand. From my side everything between 42 and 48 should be 12 and not 13.

    Thank you for your help!