我是这么写的,运行时间虽然通过了,但是好像时间挺长的。。。 -*- coding:utf-8 -*- class Solution: def FirstNotRepeatingChar(self, s): # write code here if not s: return -1 ls = [] re = [] for i in s: if i not in ls: #以ls为对照,修改re里的字符 ...