Leetcode 628. Maximum Product of Three Numbers

 

送分题

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])

 

posted @ 2019-03-18 05:49  周洋  阅读(91)  评论(0编辑  收藏  举报