TikTok interview question

It is a leetcode question.