Python Subarray Leetcode Problem 9