# -*- coding:utf-8 -*- class Solution: def FirstNotRepeatingChar(self, s): # write code here # 方法一: # for i in range(len(s)): # res = s[:i] + s[i + 1:] # if s[i] not in res: # return i # else: # return -1 # 方法二: for i in s: if s.count(i) == 1: return s.index(i) else: return -1