TikTok interview question

Leetcode hard Object Oriented Programming