Pegasystems Interview Question

1 question on recursion which was a medium level leetcode problem