This commit is contained in:
Gyubin Han
2025-02-19 14:09:55 +09:00
parent e3c6c8b32a
commit dede0dca01
36 changed files with 555 additions and 0 deletions

15
leetcode/387.py Normal file
View File

@@ -0,0 +1,15 @@
class Solution:
def firstUniqChar(self, s: str) -> int:
d={}
for i in range(len(s)):
if s[i] in d:
d[s[i]]=-1
else:
d[s[i]]=i
for i in d.values():
if i>-1:
return i
return -1