Pregunta de entrevista de Cognizant

A programming question in Python