2 lines c++ solution


  • 0
    X
    int maximumProduct(vector<int>& nums)
        {
            sort(nums.begin(),nums.end());
            return max(nums[nums.size()-1]*nums[nums.size()-2]*nums[nums.size()-3],nums[nums.size()-1]*nums[0]*nums[1]);
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.