JavaScript solution: 86% faster, 100% less memory
\nvar maxProduct = function(nums) {\n    nums.sort((a,b)=>b-a);\n    return (nums[0]-1)*(nums[1]-1);\n};\n
```\nvar maxProduct = function(nums) {\n    nums.sort((a,b)=>b-a);\n    return (nums[0]-1)*(nums[1]-1);\n};\n```
['JavaScript']