JAVA | 2-line Solution
\nclass Solution {\n    public int maxProduct(int[] nums) {\n        Arrays.sort(nums);\n        return Math.max(((nums[0]-1)*(nums[1]-1)), ((nums[nums.length-2
```\nclass Solution {\n    public int maxProduct(int[] nums) {\n        Arrays.sort(nums);\n        return Math.max(((nums[0]-1)*(nums[1]-1)), ((nums[nums.length-2]-1)*(nums[nums.length-1]-1)));\n    }\n}\n```\n**do upvote if you like the solution**
['Java']