使用一个hash和字符串来记录过程 class Solution { public: map<char, int>M; string s=""; //Insert one char from stringstream void Insert(char ch) { s += ch