Domanda di colloquio di Prudential

Explain your methodology for solving the programming problem.