my code is: for(int i=0;i<n;i++) { int x; cin>>x; a[x}++; } int y= *max_element(a,a+n); int c= INT_MIN; int k=0; for(int i=0;i<n;i++) { if(a[i]<c) { c=a[i]; k=i; } } cout<<k<<endl; wats wrong with this thanks in advace
For this ques dont work with arrs
it doesnt even work with binary search
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.