Pregunta de entrevista de bet365

Convert an OO function involving a for loop into a recursive function