Mews interview question

Easy algorithm question from the manager ; )