Python two-line easy AC code


  • -1
    T
    class Solution(object):
        def maximumProduct(self, nums):
            """
            :type nums: List[int]
            :rtype: int
            """
            nums.sort()
            return max(nums[0]*nums[1]*nums[-1], nums[-1]*nums[-2]*nums[-3])
            
    

Log in to reply
 

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