Problem Description
Given an array A, of N integers A.
Return the highest product possible by multiplying 3 numbers from the array.
NOTE: The solution will fit in a 32-bit signed integer.
Problem Constraints
3 <= N <= 5*105
Input Format
The first and the only argument is an integer array A.
Output Format
Return the highest possible product.
Example Input
Input 1:
A = [1, 2, 3, 4]
Input 2:
A = [0, -1, 3, 100, 70, 50]
Example Output
Output 1:
24
Output 1:
350000
Example Explanation
Explanation 1:
2 * 3 * 4 = 24
Explanation 2:
70 * 50 * 100 = 350000
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified.
Still have a question? Checkout Sample Codes for more details.