Make all array elements equal by repeatedly replacing largest array element with the second smallest element
Given an array arr[] of size N, the task is to count the number of operations required to make all array elements equal by replacing the largest array element with the second-largest array element, which is strictly smaller than the largest array element. Examples: Input: arr[ ] = {1, 1, 2, 2, 3}Out