Pregunta de entrevista de Whatnot

Leetcode question with additional questions about time complexity.