Given an integer array nums, return the maximum sum of any non-empty contiguous subarray. The goal is to do better than checking all possible subarrays.
nums = [-2,1,-3,4,-1,2,1,-5,4]Output6WhyThe best contiguous subarray is `[4,-1,2,1]`.nums = [1]Output1WhyThe only subarray is `[1]`.`1 <= len(nums) <= 10^5``-10^4 <= nums[i] <= 10^4`Subarray must be non-empty