Skip to content

Commit ca13986

Browse files
committed
Updated max product sub array
1 parent b71635d commit ca13986

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Medium/MaxProductSubArr.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static void main(String[] args) {
2121
* f(k) = max( f(k-1) * A[k], A[k], g(k-1) * A[k] )
2222
* g(k) = min( g(k-1) * A[k], A[k], f(k-1) * A[k] )
2323
*/
24-
public static int maxProduct(int[] A) {
24+
public int maxProduct(int[] A) {
2525
if (A == null || A.length == 0) return 0;
2626

2727
int max = A[0], min = A[0], res = A[0];

0 commit comments

Comments
 (0)