class Solution {
public int maxProduct(int[] nums
) {
int temp1
= nums
[0], temp2
= nums
[1];
for(int i
= 2; i
< nums
.length
; i
++) {
if(temp1
> temp2
)
temp2
= nums
[i
] > temp2
? nums
[i
] : temp2
;
else
temp1
= nums
[i
] > temp1
? nums
[i
] : temp1
;
}
return (temp1
-1) * (temp2
- 1);
}
}
转载请注明原文地址: https://lol.8miu.com/read-16495.html