Continuous Subarrays Leetcode Solution Python