TikTok Interview Question

Linear processing of an array.