Array
628. Maximum Product of Three Numbers
With negatives in play, the largest product of three isn't always the three biggest numbers — two deeply negative values multiply into a large positive. So the answer is the better of two candidates: the three largest numbers, or the two smallest (most negative) times the single largest.
Loading…