Python Subarray Leetcode Problem 21