Python Easy Solution

  • 0
    def maximumProduct(self, nums):
        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.