Easy C++ O(N) solution || commented
\nclass Solution {\npublic:\n    int maxProductDifference(vector<int>& nums) {\n        //we have to return the result of\n        // (firstMax*secondMax) - (fi
```\nclass Solution {\npublic:\n    int maxProductDifference(vector<int>& nums) {\n        //we have to return the result of\n        // (firstMax*secondMax) - (firstMin*secondMin)\n        int max1=INT_MIN;\n        int max2=INT_MIN;\n        int min1=INT_MAX;\n        int min2=INT_MAX;\n        for(int i=0;i<nums.size();i++)\n        {\n            \n            if(nums[i]>max1)\n            {\n                //assign the second max to max2\n                max2=max1;\n                max1=nums[i];\n            }\n            else if(nums[i]>max2)\n            {\n                //it can become second max\n                max2= nums[i];\n            }\n            \n            //check for the minimum\n            if(nums[i]<min1)\n            {\n                //it can become first minimum\n                min2=min1;\n                min1=nums[i];\n            }\n            else if(nums[i]<min2)\n            {\n                //it can become second minimum\n                min2=nums[i];\n            }\n        }\n        return (max1*max2)- (min1*min2);\n    }\n};\n```\n**Please Upvote if this helps :)**
['C']