← 返回 amazon 的题目列表Maximum Product of Three Numbers
类型:online_judge
Given an integer array nums , you need to find the maximum product that can be made by multiplying any three integers. Please return the maximum product.
Example Input and Output
Input: nums = [1,2,3]
Output: 6
Input: nums = [1,2,3,4]
Output: 24
Input: nums = [-1,-2,0,1,2]
Output: 4
Constraints
3 <= nums.length <= 10^4
-1000 <= nums[i] <= 1000
Please write an efficient algorithm to solve this problem.
Example
Input
[1,2,3]