Java One Liner Solution
\nclass Solution {\n    public int maxProduct(int[] nums) {\n        Arrays.sort(nums);\n        return (nums[nums.length-1]-1)*(nums[nums.length-2]-1);\n    }\
```\nclass Solution {\n    public int maxProduct(int[] nums) {\n        Arrays.sort(nums);\n        return (nums[nums.length-1]-1)*(nums[nums.length-2]-1);\n    }\n}\n```
['Java']