Javascript sorting solution
\nvar maxProduct = function(nums) {\n    nums.sort(function(a,b){return b-a});\n    return (nums[0]-1)*(nums[1]-1)\n};\n
```\nvar maxProduct = function(nums) {\n    nums.sort(function(a,b){return b-a});\n    return (nums[0]-1)*(nums[1]-1)\n};\n```
[]