Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 237 Bytes

387.md

File metadata and controls

13 lines (11 loc) · 237 Bytes
  • 96ms
  • 75%
class Solution:
    def firstUniqChar(self, s: str) -> int:
        counter = collections.Counter(s)
        for i,c in enumerate(s):
            if counter[c] == 1:
                return i
        return -1