unordered_map[HTML_REMOVED]count;
queue[HTML_REMOVED] q;
void insert(char ch){
if(++count[ch] > 1)
{
while(q.size() && count[q.front()] > 1) q.pop();
}
else q.push(ch);
}
//return the first appearence once char in current stringstream
char firstAppearingOnce(){
if(q.empty()) return ‘#’;
return q.front();
}
不行的就放弃,不要勉强。