Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Restricted Sum by maciejmoscicki
wynik=0
def checkio(data):
global wynik
if(len(data)==0):
data.append(wynik)
wynik=0
return data[0]
else:
wynik+=data.pop()
return checkio(data)
assert checkio([1,2,3])
assert checkio([2,2,2,2,2,2])
Oct. 12, 2016
Comments: