C++ || O(n) solution || Easy Approach
```\nclass Solution {\npublic:\n    int maxProduct(vector& nums) {\n        int max1 = INT_MIN;\n        int flag = 0;\n        for(int i = 0;i<nums.size();i++)
```\nclass Solution {\npublic:\n    int maxProduct(vector<int>& nums) {\n        int max1 = INT_MIN;\n        int flag = 0;\n        for(int i = 0;i<nums.size();i++){\n            if(max1 < nums[i]){\n                max1 = nums[i];\n                flag = i;\n            }\n        }\n        int max2=  INT_MIN;\n        for(int i = 0;i< nums.size();i++){\n            if(nums[i] > max2 && i != flag) max2 = nums[i];\n        }\n        \n        return (max2 - 1) * (max1 - 1);\n    }\n};
['C']