Easy solution - without sorting
Runtime: 44 ms, faster than 92.47% of C++ online submissions for Maximum Product of Three Numbers.\nMemory Usage: 10.9 MB, less than 100.00% of C++ online submi
Runtime: 44 ms, faster than 92.47% of C++ online submissions for Maximum Product of Three Numbers.\nMemory Usage: 10.9 MB, less than 100.00% of C++ online submissions for Maximum Product of Three Numbers.\n\n```\nint maximumProduct(vector<int>& nums) {\n        \n        int n = nums.size();\n        int minOne = INT_MAX;\n        int minTwo = INT_MAX;\n        int maxOne = INT_MIN;\n        int maxTwo = INT_MIN;\n        int maxThree = INT_MIN;\n        \n        for(int i=0; i<n; i++)\n        {\n            if(nums[i] <= minOne)\n            {\n                minTwo = minOne;\n                minOne = nums[i];\n            } else if(nums[i] < minTwo)\n            {\n                 minTwo = nums[i];\n            }\n            \n            if(nums[i] >= maxOne)\n            {\n                maxThree = maxTwo;\n                maxTwo = maxOne;\n                maxOne = nums[i];\n            } else if(nums[i] >= maxTwo)\n            {\n                maxThree = maxTwo;\n                maxTwo = nums[i];\n            }\n            else if(nums[i] > maxThree)\n            {\n                maxThree = nums[i];\n            }\n        }\n        \n        return max(maxOne*maxTwo*maxThree, maxOne*minOne*minTwo);\n    }
['C++']