Google Interview Question

Leetcode easy array manipulation question