Plum interview question

Recursion Question in round 1