TikTok interview question

Linear processing of an array.