Pregunta de entrevista de OCTO Technology

resolve this psuedo code with recursive way.