标签:
class Solution { public: int FirstNotRepeatingChar(string str) { if(str=="")return -1; vector<int> a(256,0); for(int i=0;i<str.size();i++) a[str[i]]++; for(int i=0;i<str.size();i++) if(a[str[i]]==1) return i; return -1; } };
标签:
原文地址:http://www.cnblogs.com/daocaorenblog/p/5386010.html