送分题

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
        

 

相关文章:

  • 2022-02-11
  • 2021-11-02
  • 2021-08-23
  • 2021-05-15
  • 2022-01-03
  • 2022-12-23
  • 2021-12-17
猜你喜欢
  • 2022-02-07
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
相关资源
相似解决方案