Domanda di colloquio di Mews

Easy algorithm question from the manager ; )