Pergunta de entrevista da empresa Whatnot

Leetcode question with additional questions about time complexity.