Pergunta de entrevista da empresa bet365

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