Contiguous Array Leetcode Solution 21