Pregunta de entrevista de Beyondsoft Group

Basic recursion problem - was asked to dry-run it.