链接:https://leetcode-cn.com/problems/di-yi-ge-zhi-chu-xian-yi-ci-de-zi-fu-lcof/
class Solution {
public:
char firstUniqChar(string s) {
unordered_map<char, int> count;
for (auto c: s) {
count[c]++;
}
for (auto c: s) {
if (count[c] == 1) {
return c;
}
}
return ' ';
}
};
原文:https://www.cnblogs.com/clown9804/p/12441364.html