628_Maximum Product of Three Numbers
[easy] [array, math]
Given an integer array, find three numbers whose product is maximum and output the maximum product.
Example 1:
Example 2:
Solution:
Idea:
The maximum can be achieved by multiplying the largest 3 positive values or multiplying the largest 1 positive values and the smallest 2 negative values.
Time Complexity:
Space Complexity:
Last updated