Skip to content

Commit 08cdc5a

Browse files
authored
Create maximumProductOfArray.java
1 parent 6b23e03 commit 08cdc5a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

maximumProductOfArray.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Solution {
2+
public int maxProduct(int[] nums) {
3+
Arrays.sort(nums);
4+
return (nums[nums.length-1]-1)*(nums[nums.length-2]-1);
5+
6+
}
7+
}

0 commit comments

Comments
 (0)