[LeetCode] 387. First Unique Character in a String
Python
class Solution:
def firstUniqChar(self, s: str) -> int:
temp = Counter(s)
for i in range(len(s)):
if temp[s[i]] == 1:
return i
return -1
댓글남기기