Google Interview Question

Leetcode style question involving arrays