Python Subarray Leetcode Problem 1