第一个只出现一次的字符
在字符串 s 中找出第一个只出现一次的字符。如果没有,返回一个单空格。 s 只包含小写字母。
class Solution:
def firstUniqChar(self, s: str) -> str:
dic={}
for c in s:
if c not in dic:
dic[c]=1
else:
dic[c] +=1
for c in dic:
if dic[c]==1:
return c
return " "