Pregunta de entrevista de Trexquant Investment

A recursion problem for the technical interview.