Ad
  • Default User Avatar

    Thank you very much,that was very helpful.Im beginner and i wouldnt consider this approach.

  • Custom User Avatar

    Your solution is too slow, especially for more difficult/larger inputs. The computational complexity of some problems grows rapidly with input size and sometimes trivial, naïve solutions pass for small inputs, but are not sufficiently performant for more challenging scenarios. You probably need to think of a better approach: some optimizations might help, but also might not. In the latter case, you probably need to think of a better algorithm.

    Tl;dr, you need a faster code. Most passed solutions can solve this kata within 1000ms.

    Troubleshooting Your Solution

    (Hint: try to look for pattern instead of brute-forcing)

  • Default User Avatar

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