Roblox interview question

Some problem with prefix sum and rotation