I need to write a recursive function that can add two numbers (x, y), assuming y is not negative. I need to do it using two functions which return x-1 and x+1, and I can’t use + or – anywhere in the code. I have no idea how to start, any hints?
Share
Lets say that
Then, (in pseudocode)
Observe, this only works for non-negative y.