0ms||beats 100%users||beginner friendly||easy approach
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maxProduct(vector<int>& nums) {\n        int max1=INT_MIN,max2=INT_MIN;\n        for(auto &it:nums){\n            if(it>max1){\n                max2=max1;\n                max1=it;\n            }\n            else if(it>max2&&max2!=max1){\n                max2=it;\n            }\n        }\n        //cout<<max1<<" "<<max2;\n        return (max1-1)*(max2-1);\n    }\n};\n```
['C++']