Very easy to understand --> 2 line --> C++ code
\n# Approach\n Describe your approach to solving the problem. \nThe product of the last two elements of a increasingly sorted array has the maximum product and 
\n# Approach\n<!-- Describe your approach to solving the problem. -->\nThe product of the last two elements of a increasingly sorted array has the maximum product and the product of the first two elements of the sorted array has the minimum product. And their difference is the answer.\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(nlogn)$$ \n\n--> Time complexity of the STL function sort() is **" nlogn "**\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$\n# Code\n```\nclass Solution {\npublic:\n    int maxProductDifference(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        return ((nums[nums.size()-1]*nums[nums.size()-2])-(nums[0]*nums[1]));\n    }\n};\n```\n# Please Upvote if you liked it \u2B06\uFE0F
['C++']