Gusto interview question

A Leetcode Hard, on Recursion