Pergunta de entrevista da empresa Refyne

Coding question based on recursion.