Skip to content

Commit afc2de7

Browse files
authored
Update Solution.java
1 parent 1cd4d25 commit afc2de7

File tree

1 file changed

+3
-3
lines changed
  • src/main/java/g0101_0200/s0152_maximum_product_subarray

1 file changed

+3
-3
lines changed

src/main/java/g0101_0200/s0152_maximum_product_subarray/Solution.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
public class Solution {
88
public int maxProduct(int[] nums) {
9-
int m = Integer.MIN_VALUE;
9+
int overAllMaxProd = Integer.MIN_VALUE;
1010
int n = nums.length;
1111
int start = 1;
1212
int end = 1;
@@ -19,8 +19,8 @@ public int maxProduct(int[] nums) {
1919
}
2020
start = start * nums[i];
2121
end = end * nums[n - i - 1];
22-
m = Math.max(m, Math.max(start, end));
22+
overAllMaxProd = Math.max(overAllMaxProd, Math.max(start, end));
2323
}
24-
return m;
24+
return overAllMaxProd;
2525
}
2626
}

0 commit comments

Comments
 (0)