Vanguard interview question

Basic leetcode, some OOP principles