Count decrements to nearest smaller element required to make all array elements equal
Given an array arr[] consisting of N non-negative integers, the task is to find the number of operations required to make all array elements equal. In each operation, any array element can be changed to its nearest smaller array element. Examples: Input: arr[] = {2, 5, 4, 3, 5, 4}Output: 11Explanati