Pregunta de entrevista de X

Its was Hackrank coding challenge