Note, that you can always get the answer n–1. To get this result you should make first n–1 equal using the last element as the second element in pair of the given operation. But after it, the whole array could become equal. It could happen if the sum of the array’s elements is divisible by n. So the answer is n–1 or n.
0 Comments
If you have any doubts, Please let me know