Simple Java Solution, 100% Faster (Easy to Understand)
Time Complexity : O(N)\n\nclass Solution {\n    public int maxProduct(int[] nums) {\n        \n        int max = Integer.MIN_VALUE;\n        int sec_max = Integ
Time Complexity : O(N)\n```\nclass Solution {\n    public int maxProduct(int[] nums) {\n        \n        int max = Integer.MIN_VALUE;\n        int sec_max = Integer.MIN_VALUE;\n        \n        for(int i=0;i<nums.length;i++){\n            if(nums[i] > max){\n                sec_max = max;\n                max = nums[i];\n            }\n            else if(nums[i] >= sec_max){\n                sec_max = nums[i];\n            }\n        }\n        \n        return ((max-1)*(sec_max-1));\n    }\n}\n```\n\nComment down if you don\'t understand anything.\n\nThank you!
['Array', 'Java']