Pergunta de entrevista da empresa Gusto

Medium/Hard Leetcode Question. Included recursion.