[剑指Offer-50][简单][哈希表] 第一个只出现一次的字符
题目描述
s = "abaccdeff"
返回 "b"
s = ""
返回 " "解题思路
class Solution:
def firstUniqChar(self, s: str) -> str:
cache = dict()
for c in s:
cache[c] = cache.get(c, 0) + 1
for k, v in cache.items():
if v == 1:
return k
return ' '最后更新于