TikTok interview question

Leetcode, and space and time complexity.