🔥C++|| Easy to understand || Beginner Friendly✅✅✅
Intuition\nTo find the max difference between any two elements like a-b we should make "a" as large as possible and "b" as small as possible.\n\n# Approach\nIf 
# Intuition\nTo find the max difference between any two elements like a-b we should make "a" as large as possible and "b" as small as possible.\n\n# Approach\nIf we sort the array the last two elements will give us the maximum 2 elements and 1st two elements will give the 2 smalles elements.\n\n# Complexity\n- Time complexity:\nO(logn)\n\n- Space complexity:\nNo additional space taken.\n\n# Code\n```\nclass Solution {\npublic:\n    int maxProductDifference(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int n=nums.size();\n        int a  =  nums[n-1]*nums[n-2];\n        int b = nums[0]*nums[1];\n        \n        return a-b;\n        \n    }\n};\n```\n***Pls upvote if you find this useful :)***
['Sorting', 'C++']