Contiguous Array - Leetcode 525 - Python