Maximum Sum Circular Subarray
Return the maximum possible sum of a subarray in a circular array.
Examples
Input: [1,-2,3,-2]
Output: 3
Input: [5,-3,5]
Output: 10
Hints
Consider the scenario where the maximum subarray wraps around the end of the array to the beginning. How can you identify such cases?
If the maximum subarray is circular, how does the sum of this subarray relate to the total sum of the array and the minimum subarray?
After computing the maximum subarray sum using Kadane's algorithm, what additional step is needed to handle the circular case, and why is it necessary?
Related Problems
Maximum Sum Circular Subarray
Return the maximum possible sum of a subarray in a circular array.