```
def firstUniqChar(self, s):
"""
:type s: str
:rtype: int
"""
hashmap={}
for i in range(0,len(s)):
hashmap[s[i]]=0
for i in range(0,len(s)):
hashmap[s[i]]+=1
for i in range(0,len(s)):
if hashmap[s[i]]==1:
return i
return -1
```