Gusto interview question

Medium/Hard Leetcode Question. Included recursion.