Given an array of N numbers with M distinct no . Find minimum no. of numbers such that on permuting those in any order , digit with same value come together.
Ex: 1 3 1 5 6
Choosing indices 0 and 1 or 1 and 2 makes all the one’s together
So ans: 2 ( two indices are chosen)