Ad
  • Default User Avatar

    It's hard to say, but looking at your code I'm guessing you are failing at the test case where n=0 which will lead to your tmp list being empty regardless of how you change indices.

    In general, to troubleshoot you should first try printing the test inputs - in Python just add:

    def zeros(n):
      print(n)
      rest of your code here
    

    where here n is the name of the input, to your code so that you can see in the console which inputs are causing you to fail.