Beats 100% || simple solution || 0ms Time complexity ||
\n\n# Code\n\nclass Solution {\n    public int maxProduct(int[] nums) {\n        int max=0;\n        int secondmax=0;\n        for(int i=0;i<nums.length;i++)\n 
\n\n# Code\n```\nclass Solution {\n    public int maxProduct(int[] nums) {\n        int max=0;\n        int secondmax=0;\n        for(int i=0;i<nums.length;i++)\n        {\n            if(nums[i]>=max){\n                secondmax=max;\n                max=nums[i];\n            }\n            else if(nums[i]>secondmax){\n                secondmax=nums[i];\n            }\n        }\n        return (max-1)*(secondmax-1);\n        \n    }\n}\n```
['Java']