Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfa0f32d

Browse files
refactor 53
1 parent2f9568f commitfa0f32d

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
publicclass_53 {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp