Skip to content

Commit fa0f32d

Browse files
refactor 53
1 parent 2f9568f commit fa0f32d

File tree

1 file changed

+8
-2
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
/**
44
* 53. Maximum Subarray
5+
* Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
56
*
6-
* Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
7-
* For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2,1] has the largest sum = 6.
7+
* Example:
8+
* Input: [-2,1,-3,4,-1,2,1,-5,4],
9+
* Output: 6
10+
* Explanation: [4,-1,2,1] has the largest sum = 6.
11+
*
12+
* Follow up:
13+
* If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle.
814
*/
915

1016
public class _53 {

0 commit comments

Comments
 (0)