Pregunta de entrevista de Intact

Python object-oriented programming and basic data structure problem, leetcode medium difficulty.