Good evening...
Need some help about how to correct my code to solve stair-steps:
def checkio(numbers):
if not numbers or len(numbers) == 1 and numbers[0] < 0:
return 0
else:
if numbers[0] > 0:
return numbers[0] + checkio(numbers[1:])
else:
return numbers[1] + checkio(numbers[2:])
I have a problem with last test case ((-10, -1, -1, -10)).
Created at: 2015/08/31 19:15; Updated at: 2015/09/01 05:53