Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Restricted Sum by Degusto
def checkio(data, i = 0):
result = 0
if i - 2 >= len(data):
return result
if i < len(data):
result += data[i]
if i + 1 < len(data):
result += data[i + 1]
return result + checkio(data, i + 2)
def s(a,b):
return a + b
Nov. 18, 2015