题解 | #首个重复字符#

首个重复字符

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
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务