Ad
  • Default User Avatar

    There shouldn't be an issue with timeout on this one unless you're overcomplicating the algorithm. I heavily leveraged loops in my solution but still made it with time to spare.

    Perhaps change your approach. It might help to look up, mathematically, how to solve a problem like this.

    If you have the right approach, you won't need to optimize your algorithm.

  • Default User Avatar

    Might have been an infinite loop issue. Not sure though.

  • Default User Avatar

    Just a heads up, this solution is entirely dependent on server execution time (the main issue with this kata). If servers are moving slow, this solution fails to complete in time. If servers are moving at a normal pace, this works.

  • Default User Avatar

    Look man, I enjoyed solving this problem. What I didn't enjoy was spending an hour optimizing it just so that it could be submitted.

    Good idea, bad execution. Thank you for the problem though, it was initially fun to solve.

    (edit): after completing the kata, I looked at the solutions for JS. The most common successful solution in JS will fail based on server speed roughly half the time.