We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1cd4d25 commit afc2de7Copy full SHA for afc2de7
src/main/java/g0101_0200/s0152_maximum_product_subarray/Solution.java
@@ -6,7 +6,7 @@
6
7
public class Solution {
8
public int maxProduct(int[] nums) {
9
- int m = Integer.MIN_VALUE;
+ int overAllMaxProd = Integer.MIN_VALUE;
10
int n = nums.length;
11
int start = 1;
12
int end = 1;
@@ -19,8 +19,8 @@ public int maxProduct(int[] nums) {
19
}
20
start = start * nums[i];
21
end = end * nums[n - i - 1];
22
- m = Math.max(m, Math.max(start, end));
+ overAllMaxProd = Math.max(overAllMaxProd, Math.max(start, end));
23
24
- return m;
+ return overAllMaxProd;
25
26
0 commit comments