题解 | #首个重复字符#
首个重复字符
http://www.nowcoder.com/practice/dab59997905b4459a42587fece8a75f4
class FirstRepeat:
def findFirstRepeat(self, A, n):
# write code here
hash = {}
for i in range(n):
if hash.has_key(A[i]):
return A[i]
hash[A[i]] = i