math - Max product of the three numbers for a given array of size N -


I need to write a number, which is to find the maximum number of three numbers for the array given in a number. Is there any effective algorithm for this? I need to know the algorithm step any of the algorithms I thought that works for all test cases. Thanks! FYI Array may contain + ve, -ve or zero elements)

The three largest numbers array (N1, N2, N3) and two smallest numbers (M1, M2).

The answer is either N1x N 2 X N3 or N1 X M1 x M2


Comments

Popular posts from this blog

.net - C# List<T>.Find(x=>x.Rectangle.Contains(Point)) FAIL -

iphone - Smoothing a rounded stroke in Core Graphics -

c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -