Contiguous Array Leetcode Solution