Sort, then compare two candidates:
p1 = product of three largest values
p2 = product of two smallest (potentially negative) values and the largest
For [-10;-10;1;3;2]:
sorted = [-10;-10;1;2;3]
p1 = 3 * 2 * 1 = 6
p2 = (-10) * (-10) * 3 = 300
max = 300
Tests List.sort + Array.of_list + arr.(n-i) end-walk + candidate-pick
via if-then-else.
104 baseline programs total.