Pregunta de entrevista de elminda

I had to solve a coding task