Java beats 100% without sorting
\nclass Solution {\n    public int maxProduct(int[] nums) {\n        int max1 = nums[0]>nums[1]?nums[0]:nums[1];\n        int max2 = nums[0]<nums[1]?nums[0]:num
```\nclass Solution {\n    public int maxProduct(int[] nums) {\n        int max1 = nums[0]>nums[1]?nums[0]:nums[1];\n        int max2 = nums[0]<nums[1]?nums[0]:nums[1];\n        for(int i=2;i<nums.length;i++){\n            if(nums[i]>max1){\n                max2=max1;\n                max1=nums[i];                \n            }\n            else if(nums[i]>max2)\n                max2=nums[i];\n        }\n        return (max1-1)*(max2-1);\n    }\n}\n```
[]