Easiest C++ Solution
Intuition\nwe will sort the vector.\n\n# Approach\nAfter sorting answer will always be product of first 2numbers and last number or last 3numbers.\n# Complexity
# Intuition\nwe will sort the vector.\n\n# Approach\nAfter sorting answer will always be product of first 2numbers and last number or last 3numbers.\n# Complexity\n- Time complexity:\nnlogn\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int maximumProduct(vector<int>& nums) {\n\n        sort(nums.begin(),nums.end());\n\n        int e=nums.size()-1;\n        int ans1=nums[e]*nums[e-1]*nums[e-2];\n        int ans2=nums[e]*nums[0]*nums[1];\n\n        int final=max(ans1,ans2);\n        return final;\n        \n    }\n};\n```
['C++']