Ad
  • Custom User Avatar

    It is not surprising that you are able to sometimes pass and sometimes fail with the same code, because most Codewars kata include random tests that are re-generated every time you try to submit your code. So it can happen that you are "lucky" in some submissions and "unlucky" in other.

    For your buggy solution specifically (although you do not provide it so I cannot see it), it could mean that the Python submission tests are too weak and should be hardened. However, it is not always easy to predict all mistakes people could make, as it is possible to solve the same task with many different algorithms and some solutions have subtle bugs that only happen for rare values.

  • Custom User Avatar

    your algo is wrong

    please re-read the description