Pergunta de entrevista da empresa BearingPoint

Live coding exercise in which the constraint was to implement it recursively