Leetcode Maximum Subarray Solution Finish Restorer