TikTok interview question

Time and space complexity, algorithms and data structures.