Pregunta de entrevista de Microsoft

How would you code in less time this ...?