class Solution(object):
def firstUniqChar(self, s):
"""
:type s: str
:rtype: int
"""
flag=set()
for i in range(0,len(s)):
if s[i] in flag:
continue
f=0
for j in range(i+1,len(s)):
if s[j]==s[i]:
flag.update(s[i])
f=1
break
if f==0:
return i
return -1