Whatnot interview question

Leetcode question with additional questions about time complexity.