Maximum Product of Three Numbers Solution in C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\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)$$ -->\nO(nlogn)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\npublic:\n    int maximumProduct(vector<int>& nums) {\n        int prod1, prod2;\n        sort(nums.begin(), nums.end());\n        prod1 = nums[nums.size()-1]*nums[nums.size()-2]*nums[nums.size()-3];\n        prod2 = nums[nums.size()-1]*nums[0]*nums[1];\n        return max(prod1, prod2);\n    }\n};\n```\n![upvote new.jpg](https://assets.leetcode.com/users/images/69937238-eca1-4173-b4f3-41dce5d4cf8e_1683046364.6328144.jpeg)\n
['C++']