Java all positive or negative
\npublic int maxProduct(int[] nums) {\n        Arrays.sort(nums);\n        return Math.max((nums[0] - 1) * (nums[1] - 1), (nums[nums.length - 1] - 1) * (nums[nu
```\npublic int maxProduct(int[] nums) {\n        Arrays.sort(nums);\n        return Math.max((nums[0] - 1) * (nums[1] - 1), (nums[nums.length - 1] - 1) * (nums[nums.length - 2] - 1));\n    }\n```
[]