easy/strings 387 성공
This commit is contained in:
21
easy/strings/387.py
Normal file
21
easy/strings/387.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# First Uniqye Character in a String
|
||||
|
||||
from collections import Counter
|
||||
|
||||
class Solution:
|
||||
def firstUniqChar(self, s: str) -> int:
|
||||
c = Counter(s)
|
||||
for key in c:
|
||||
if c[key] == 1:
|
||||
return s.index(key)
|
||||
else:
|
||||
return -1
|
||||
|
||||
|
||||
"""
|
||||
걸린 시간: 10:24~
|
||||
|
||||
복잡도:
|
||||
|
||||
해설:
|
||||
"""
|
||||
Reference in New Issue
Block a user