摘要: 自己的思路并不困难,通过遍历一遍字符串,将对应的字符填入哈希表,完成一次遍历后再次遍历字符串,返回第一个哈希表中对应为1的字符的索引。 class Solution { public: int firstUniqChar(string s) { unordered_map<char,int> goo 阅读全文
posted @ 2021-03-10 15:06 zhaohhhh 阅读(46) 评论(0) 推荐(0)