algorithms icon indicating copy to clipboard operation
algorithms copied to clipboard

Fix the bug in the Maximum Subarray algorithm which outputs zero when…

Open CloudSir opened this issue 3 months ago • 0 comments

Fix the bug in the Maximum Subarray algorithm which outputs zero when the array is all negative numbers. For example, when the array is [-2, -3, -2, -1, -2, -4, -5, -3], the correct output is -2, but it outputs 0.

CloudSir avatar Oct 01 '25 13:10 CloudSir