Count triplets (i, j, k) in an array of distinct elements such that a[i] < a[j] > a[k] and i < j < k

Given an array arr[] consisting of N distinct integers, the task is to count the number of triplets (i, j, k) possible from the array… Read More