Ad
  • Custom User Avatar

    Are you sure you're using the specific space character given in the description? because it's not the one of the space bar of your keyboard.

  • Default User Avatar

    The expected output is a single string with each row separated with line break.
    You need to join your list.

  • Default User Avatar

    You've answered your own question: what's wrong is, that it runs out of time.

    You need to find a more efficient (faster) algorithm - currently your approach takes too long to find answers for inputs such as n = 1000000000.

  • Default User Avatar

    Hi and welcome to Codewars.

    If you decide, each time your code doesn't work, that the problem is with the kata rather than your code, then you are going to have a bad experience!

    It takes 2 seconds to think of a simple test to see that it is your solution, not the kata, that has some problems: for example try this input: [10,-1,15]. The correct answer is obviously 24. Your code returns 10.

  • Custom User Avatar

    Python Completions 21756

    What would be the problem?

  • Custom User Avatar

    That's because you mutate the list you're iterating through, note the amount of 0s that your code skipped and how many pairs of 0s you have in the input.

  • Custom User Avatar

    For inputs a1=[2,2] a2=[4] your solution returns True, but it sohuld return False.