c++ one liner simple approach
PLEASE UPVOTE IF U FIND HELPFUL\n\nclass Solution {\npublic:\n    int maxProduct(vector<int>& nums) {\n        sort(nums.rbegin(),nums.rend()); return (nums[0]-
**PLEASE UPVOTE IF U FIND HELPFUL**\n```\nclass Solution {\npublic:\n    int maxProduct(vector<int>& nums) {\n        sort(nums.rbegin(),nums.rend()); return (nums[0]-1)*(nums[1]-1);\n    }\n};\n```
['C', 'Sorting']