mini and maxi to the first element of the array.cntmin and cntmax to 1, representing the count of the minimum and maximum elements respectively.mini, update mini and reset cntmin to 1.
b. If the current element is equal to mini, increment cntmin.
c. If the current element is greater than maxi, update maxi and reset cntmax to 1.
d. If the current element is equal to maxi, increment cntmax.mini is equal to maxi, return 0 since all elements are the same.n - (cntmin + cntmax)).