classSolution { public: //Insert one char from stringstream voidInsert(char ch){ v.push_back(ch); umap[ch]++; } //return the first appearence once char in current stringstream charFirstAppearingOnce(){ for (char ch : v) { if (umap[ch] == 1) return ch; } return'#'; }