Finds the max-sum subarray by dividing the array and combining across the midpoint.
Step 1 of 35
Maximum Subarray (Divide & Conquer): split array at midpoint, recurse on each half, find max crossing subarray, return the best of the three.
At each level: find max in left half, right half, and crossing the midpoint. Return the best of the three. O(n log n) time, O(log n) stack space.