Pregunta de entrevista de Sinch

Explain the solution step by step