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

Commit1c24038

Browse files
committed
152 (3) add comments
1 parentf64b853 commit1c24038

File tree

3 files changed

+3
-119
lines changed

3 files changed

+3
-119
lines changed

‎src/_152_MaximumProductSubarray/Solution.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public int maxProduct(int[] nums) {
2727
}
2828
// initialize
2929
intres =nums[0];
30-
intmax =nums[0];
31-
intmin =nums[0];
32-
// dp
30+
intmax =nums[0];// max product that ending at current index
31+
intmin =nums[0];// min product that ending at current index
32+
3333
for (inti =1;i <n;i++) {
3434
intnum =nums[i];
3535
intlmax =max *num;

‎src/_152_MaximumProductSubarray/Solution2.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

‎test/_152_MaximumProductSubarray/Solution2Test.java

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp