Pregunta de entrevista de Bloomberg

i don't remember, some recursion