剑指offer---字符流中第一个不重复的字符
class Solution { string str; int hash[256]; public: //Insert one char from stringstream void Insert(char ch) { str.push_back(ch); hash[ch]++; } //return the first appearence once char in current stringstream char FirstAppearingOnce() { for(int i = 0; i < str.size(); ++i){ if(hash[str[i]] == 1) return str[i]; } return '#'; } };