class Solution
{
public:
//Insert one char from stringstream
void Insert(char ch)
{
s += ch;
}
//return the first appearence once char in current stringstream
char FirstAppearingOnce()
{
for(int i=0;i<s.length();i++){
if(count(s.begin(),s.end(),s[i]) == 1)return s[i];
}
return '#';
}
private:
string s = "";
};
京公网安备 11010502036488号