TikTok interview question

Leetcode easy. Discussion about the role