Split the array at the midpoint. The maximum subarray is either: Entirely in the left half.
Entirely in the right half.
Crossing the midpoint.
Recursively solve left and right. For the crossing case, find max sum extending left from mid and max sum extending right from mid, then combine.
.