Maximum Subarray Problem Leetcode Python Pandas