python3
第一个只出现一次的字符
http://www.nowcoder.com/questionTerminal/1c82e8cf713b4bbeb2a5b31cf5b0417c
py3的话一下子就用这种常规的做法做出来了,看了一下别人的题解,以为有什么快速的方法,然而都差不多,就酱吧
# -*- coding:utf-8 -*- class Solution: def FirstNotRepeatingChar(self, s): # write code here if not s: return -1 for i in range(len(s)): if s.count(s[i]) == 1: return i return -1