Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
I going to write clear recursive code solution in Clear category for Restricted Sum by Taras_Lutsyshyn
def checkio(data):
if len(data) > 1:
data[0] = data.pop(0) + data[0]
checkio(data)
return data[0]
if __name__ == "__main__":
assert checkio([1, 2, 3]) == 6, "Frist test"
assert checkio([2, 2, 2, 2, 2, 2]) == 12, "Second test "
Jan. 29, 2019