Ad
  • Default User Avatar

    Could you provide more details about the algorithm you are using? It's absolutely possible to pass al the test in under 5 seconds,but it will be difficult to determine what the problem is in your case without having any details about the code, however, here are some general recomendations:

    Converting to int(x) wont work, as the numbers are too large (Even tough the documentation says python's integers are arbitary presicion, they are not)

    Utilizing any loop will be too slow for this kata, as even 1 loop will create time complexity of O(n), and you need O(1)

    Do some research about libraries that spetialize on handling big numbers

  • Default User Avatar

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

  • Custom User Avatar

    The expected value is always a number.

  • Custom User Avatar

    you have some if/else branches missing a retrun