```
class Solution(object):
def firstUniqChar(self, s):
"""
:type s: str
:rtype: int
"""
d = dict()
for i in range(len(s)):
if d.setdefault(s[i],[]) or True:
d[s[i]].append(i)
for i in range(len(s)):
if len(d[s[i]]) == 1:
return(i)
return(-1)
```