Ad
  • Custom User Avatar
  • Custom User Avatar

    Nothing is wrong with random tests. What is wrong is your code, that produces the following error, as you can see:

    RecursionError: maximum recursion depth exceeded in comparison
    

    Which means there are too many recursive calls. You can make a research online to try and see how you could handle that, though, if I may give you an advice: don't use recursion here. Recursive solutions are generally bad (bad performance + crash prone) when recursion is too deep.