C++ Solution || Easy || Brute Force ✔✔
Complexity\n- Time complexity: O(nlogn)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n
# Complexity\n- Time complexity: $$O(nlogn)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maximumProduct(vector<int>& nums) {\n        int n= nums.size();\n        sort(nums.begin(),nums.end());\n        int ans1= nums[n-1]*nums[n-2]*nums[n-3];\n        int ans2= nums[0]*nums[1]*nums[n-1];\n        return max(ans1,ans2);\n    }\n};\n```
['Array', 'Math', 'Sorting', 'C++']