Maximum And Minimum Subarray Leetcode