Leetcode 387. First Unique Character in a String

送分题

class Solution(object):
    def firstUniqChar(self, s):
        """
        :type s: str
        :rtype: int
        """
        count=collections.Counter(s)
        for i,v in enumerate(s):
            if count[v]==1:
                return i
        return -1
        
原文地址:https://www.cnblogs.com/zywscq/p/10562579.html