Easy To Understand | 3 Lines 🚀🚀
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Use this test case for better understanding --> [-100,-98,-1,2,3,4]\n\n#
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n Use this test case for better understanding --> [-100,-98,-1,2,3,4]\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        ios_base::sync_with_stdio(false);\n        cin.tie(0);\n        cout.tie(0);\n        \n        sort(nums.begin(),nums.end());\n        int n = nums.size();\n\n        return max(nums[n-1] * nums[n-2] * nums[n-3], nums[0] * nums[1] * nums[n-1]);\n    }\n};\n```
['Array', 'Math', 'C', 'Sorting', 'C++', 'Java', 'Python3']