Pregunta de entrevista de Mews

Easy algorithm question from the manager ; )