题解 | #删除字符串中出现次数最少的字符#
删除字符串中出现次数最少的字符
https://www.nowcoder.com/practice/05182d328eb848dda7fdd5e029a56da9
#include <climits>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
string str;
getline(cin,str);
unordered_map<char,int> mp;
int mi=10000;
for(char c:str){
mp[c]++;
}
for(auto j=mp.begin();j!=mp.end();j++)
{
if(j->second<mi){
mi=j->second;
}
}
for(char d:str){
if(mp[d]!=mi){
cout<<d;
}
}
}
// 64 位输出请用 printf("%lld")


