Simple C++ Solution
Intuition\n Describe your first thoughts on how to solve this problem. \nFirst we sort the vector then we return the product of first 2 element and last element
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nFirst we sort the vector then we return the product of first 2 element and last element or product of last three element\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maximumProduct(vector<int>& arr) {\n        int n=arr.size();\n    \tsort(arr.begin(),arr.end());\n    \n    \treturn max(arr[0]*arr[1]*arr[n-1],arr[n-1]*arr[n-2]*arr[n-3]);\n    \n    }\n};\n```
['C++']