Skip to content

Commit e0300ef

Browse files
committed
Time: 1 ms (100.00%), Space: 51.7 MB (81.75%) - LeetHub
1 parent 0445680 commit e0300ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

0053-maximum-subarray/0053-maximum-subarray.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public int maxSubArray(int[] nums) {
66
for (int i = 1; i < nums.length; i++) {
77
int num = nums[i];
88
curSum = Math.max(curSum + num, num);
9-
answer = Math.max(curSum, answer);
9+
answer = Math.max(answer, curSum);
1010
}
1111

1212
return answer;

0 commit comments

Comments
 (0)