Skip to content

Commit 1c24038

Browse files
committed
152 (3) add comments
1 parent f64b853 commit 1c24038

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
int res = nums[0];
30-
int max = nums[0];
31-
int min = nums[0];
32-
// dp
30+
int max = nums[0]; // max product that ending at current index
31+
int min = nums[0]; // min product that ending at current index
32+
3333
for (int i = 1; i < n; i++) {
3434
int num = nums[i];
3535
int lmax = 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy