剑指offer-34-第一个只出现一次的字符
第一个只出现一次的字符
http://www.nowcoder.com/questionTerminal/1c82e8cf713b4bbeb2a5b31cf5b0417c
# -*- coding:utf-8 -*-
class Solution:
def FirstNotRepeatingChar(self, s):
# write code here
indexs=-1
new_s=list(s) ##字符串转化为列表
for i in range(len(new_s)):
if s.count(new_s[i])==1:
indexs=s.index(new_s[i])
break
return indexs
小天才公司福利 1313人发布