Refyne interview question

Coding question based on recursion.