Pregunta de entrevista de IBM

Solving coding problems, you can change your perferred language