Solution 1 - Sort
Maximum is max(product of 3 largest, product of 2 smallest and largest).
""" 0628.1 - Maximum Product of Three Numbers - Solution 1 - Sort """
from typing import List
class Solution:
def maximumProduct(self, nums: List[int]) -> int:
nums.sort()
return max(nums[-1]*nums[-2]*nums[-3], nums[0]*nums[1]*nums[-1])