TikTok interview question

One medium LC question each round.