Subarray Problems On Leetcode Python