Gorgias (CA) Interview Question

Similar to easy Array Manipulation problems on Leetcode