Example 1maxSubArray()InputCopynums = [-2,1,-3,4,-1,2,1,-5,4]OutputCopy6WhyThe subarray [4,-1,2,1] has the largest sum = 6.