Maximize the value of (A[i]-A[j])*A[k] for any ordered triplet of indices i, j and k
Given an array A consisting of N positive integers and for any ordered triplet( i, j, k) such that i, j, and k are all distinct and 0 ? i, j, k < N, the value of this triplet is (Ai ? Aj)?Ak, the task is to find maximum value among all distinct ordered triplets. Note: Two triplets (a, b, c) and (