Maximum product of three Numbers || simple || efficient || sorting
\nclass Solution {\npublic:\n    \n    static int cmp(int a,int b)  // This cmp function to sort in descending order\n    {                            // To wri
```\nclass Solution {\npublic:\n    \n    static int cmp(int a,int b)  // This cmp function to sort in descending order\n    {                            // To write this type of function concept is simple\n       \n\t\treturn a>b;              // Try to think what you want like you basically \n                                 // want a>b i.e first no > second no. (both no are integer) though given  \n\t\t\t\t\t\t\t\t // input was vector\n    }\n        \n    int maximumProduct(vector<int>& nums) {\n           \n        sort(nums.begin(),nums.end(),cmp);\n        \n        int positive= nums[0]*nums[1]*nums[2], \n            negative= nums[nums.size()-1]*nums[nums.size()-2]*nums[0];  // if array contents negative no as well.\n        \n        return positive>negative? positive : negative;     \n    }\n};\n```\n![image](https://assets.leetcode.com/users/images/86ef8c5a-ed3c-4c10-b71d-9df62768c8d9_1654833120.7555354.jpeg)\n\nPlease upvote !!!!!\n(Top-left button)\n
['C', 'Sorting', 'C++']