Given an integer array nums, find the subarray with the largest sum and return the sum.
Example: For [-2,1,-3,4,-1,2,1,-5,4], the answer is from subarray [4,-1,2,1]. While Kadane's algorithm solves it in , the D&C approach is instructive.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Given an integer array nums, find the subarray with the largest sum and return the sum.
Example: For [-2,1,-3,4,-1,2,1,-5,4], the answer is from subarray [4,-1,2,1]. While Kadane's algorithm solves it in , the D&C approach is instructive.