Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Restricted Sum by bswitaj
l=0
def checkio(data):
global l
if len(data)==0:
print(l)
y=l
l=0
return y
else:
print (data[0])
l+=data[0]
x=data[0]
data.remove(x)
return checkio(data)
if __name__ == '__main__':
assert checkio([2,2,2,2,2,2]) == 12, "First"
Oct. 17, 2017