Pregunta de entrevista de IBM

Solve a programming question/Write a program