Java
Upvote if u like it\n\npublic int maxProduct(int[] nums) {\n    int firstMax = 0;\n    int secondMax = 0;\n\n    for (int num : nums) {\n        if (num > first
Upvote if u like it\n```\npublic int maxProduct(int[] nums) {\n    int firstMax = 0;\n    int secondMax = 0;\n\n    for (int num : nums) {\n        if (num > firstMax) {\n            secondMax = firstMax;\n            firstMax = num;\n        } else if (secondMax < num) {\n            secondMax = num;\n        }\n    }\n\n    return (firstMax - 1) * (secondMax - 1);\n}\n```
['Java']