3 ms·
It's python, so it can't handle it either way, but by moving the final "+1" into the function call, it becomes tail-recursive. return add_r(a+1, b, c+1)
by betenoire 13y ago
It's python, so it can't handle it either way, but by moving the final "+1" into the function call, it becomes tail-recursive.
return add_r(a+1, b, c+1)