思路:
暴力枚举
代码:
class Solution {
public:
char firstUniqChar(string s) {
unordered_map<char,int> hash;
for(auto ss : s){
hash[ss]++;
}
for(auto ss : s){
if(hash[ss] == 1) return ss;
}
return ' ';
}
};
评论区