Skip to content

Commit 45b4b5b

Browse files
refactor 53
1 parent 6567f67 commit 45b4b5b

File tree

1 file changed

+4
-1
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+4
-1
lines changed

src/main/java/com/fishercoder/solutions/_53.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ public class _53 {
44

55
public static class Solution1 {
66
/**
7-
* https://leetcode.com/problems/maximum-subarray/discuss/20211/accepted-on-solution-in-java
7+
* It boils down to:
8+
* whether it's worth to include the current element into the sum or not.
9+
* <p>
10+
* It'll be very straightforward once you draw this array [-2,1,-3,4,-1,2,1,-5,4] out on a paper and walk through it.
811
*/
912
public int maxSubArray(int[] nums) {
1013
int globalMax = nums[0];

0 commit comments

Comments
 (0)