Pregunta de entrevista de Broadway Technology

Coding question in python language