Pregunta de entrevista de Ciena

Experience, a coding question to show I understand the logic.