Max Product of Three Numbers
Given a list of integers nums
, find the largest product of three distinct elements.
Constraints
3 ≤ n ≤ 100,000
wheren
is the length ofnums
https://binarysearch.com/problems/Max-Product-of-Three-Numbers
Examples
Example 1
Input
- nums =
[5, 4, 1, 3, -2, -2]
Output
- answer =
60
Explanation
We can multiply 5 * 4 * 3
Example 2
Input
- nums =
[-3, 1, 1, 0]
Output
- answer =
0
Explanation
We can multiply 1 * 1 * 0
Leave a comment