Pregunta de entrevista de Barclays

Coding problem statement to solve