Back to questions

Maximum Product of Three Numbers D.E. Shaw Python Interview Question

Maximum Product of Three Numbers

D.E. Shaw Python Interview Question

Given a list of integers, return the maximum product of any three numbers in the array.

For example, for A = [1, 3, 4, 5], you should return 60, since 345=603 * 4 * 5 = 60.

For B = [−4, −2, 3, 5] you should return 40 since 425=40 -4 * -2 * 5 = 40

p.s. this is the same as question 9.2 in Ace the Data Science Interview.

Input

Python

Output