Python Easy Solution


  • 0
    P
    def maximumProduct(self, nums):
        nums.sort()
        return max(nums[0] * nums[1] * nums[-1], nums[-1] * nums[-2] * nums[-3])
    

    If the max product comes from negative items, it must takes two of them to get positive result.


Log in to reply
 

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