Ad
  • Default User Avatar

    This was my first thought lol. My solution isn't clever, but it's O(n) and I got it working in under 5min. The only other 5kyu I've done took me more than a day and pushed me hard. This definitely feels like a 7 and not even on the harder side of 7.

  • Default User Avatar

    Great problem. My first 5 Kyu... and boy was it a challenge for me. All my solutions are so bulky lol.

  • Default User Avatar

    Ah I see thank you for explaining it and fixing it. So me using pop() was the problem. I'll keep it in mind that some problems may not play well with mutating an array.

  • Custom User Avatar

    @SinisterSup, your solution supposed to stop when you get exactly on the final square (not paying attention to the snakes/ladders it has), i.e. if on the next turn you get exactly on the final square, you has to return it, ignoring the value of that square (0, snakes or ladders).

    Your code, however, doesn't stop after reaching it, and continues the turns.

  • Custom User Avatar

    "exhausted" means "the array has become empty, and then that empty array has been used for the next test case, although it was supposed to be the same as before the first test".

  • Custom User Avatar

    Even I'm facing the same issue with broken go tests, (11/100), (53/100), (56/100) and (77/100) numbered test are throwing very similar errors, though my code is working properly.

  • Default User Avatar

    Hmm, but I failed the same test case where I was just modifying the board by updating our position in it with an "x". I assumed to solve this we'd need to update one of the parameters... but I suppose that only matters if you're doing it recursively. I coulda just tracked my position with a variable and a while loop or something and it probably woulda been simpler.

    What did you mean by 'exhausted' though.

  • Custom User Avatar

    The reason why your solution didn't pass is because you modified the input array dice, so after the first test in the section it was exhausted.

    Thanks for noting that out, I changed the tests so they won't be modified after each function call, now your solution should pass.

  • Default User Avatar

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