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
Post a Comment