Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Restricted sum solution in Clear category for Restricted Sum by graffme
def count(data, result = 0):
if len(data) == 0:
return result
else:
return count(data, result + data.pop())
def checkio(data):
return count(data)
if __name__ == "__main__":
assert checkio([1,2,3]) == 6, "first test"
Jan. 11, 2017