Pergunta de entrevista da empresa IXL Learning

One leetcode medium question with a bit of OOP