class Solution{
public:
string str;
int i=0;
int cnt[256]={0};
//Insert one char from stringstream
void insert(char c){
str+=c;
cnt[c]++;
}
//return the first appearence once char in current stringstream
char firstAppearingOnce(){
while(i<str.size())
{
if(cnt[str[i]]==1) return str[i];
i++;
}
return '#';
}
};
标签:字符,cnt,第一个,int,流中,char,stringstream
From: https://www.cnblogs.com/tangxibomb/p/17358952.html