#自己的
class Solution:
def firstUniqChar(self, s: str) -> str:
n=len(s)
c=[0]*26
for ch in s:
j=ord(ch)-97
c[j]=c[j]+1
for ch in s:
if c[ord(ch)-97]==1:
return ch
return " "
# 别人的
class Solution:
def firstUniqChar(self, s: str) -> str:
dic = {}
for c in s:
dic[c] = not c in dic
for c in s:
if dic[c]: return c
return ' '