Pergunta de entrevista da empresa TikTok

How about the time complexity.