Python Subarray Leetcode Problem 643