We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
intmain(){intn,i,j,max=0,cnt;scanf("%d",&n);inta[n];for(i=0;i<n;i++)scanf("%d",&a[i]);for(i=0;i<n;i++){cnt=0;for(j=0;j<n;j++){if(a[i]==a[j])cnt++;}if(cnt>max)max=cnt;}printf("%d",n-max);/* Enter your code here. Read input from STDIN. Print output to STDOUT */return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Equalize the Array
You are viewing a single comment's thread. Return to all comments →