TikTok interview question

working with arrays and dictionary