```
class Solution(object):
def firstUniqChar(self, s):
"""
:type s: str
:rtype: int
"""
map = {}
for i in range(len(s)):
if s[i] in map:
map[s[i]].append(i)
else:
map[s[i]] = [i]
first = float('inf')
for m in map:
if len(map.get(m)) == 1:
first = min(first, map.get(m)[0])
return first if first != float('inf') else -1
```