TikTok interview question

I could not pass the coding round