feat: Initial commit
This commit is contained in:
14
removeDuplicates.py
Normal file
14
removeDuplicates.py
Normal file
@@ -0,0 +1,14 @@
|
||||
def removeDuplicates(st: str):
|
||||
st = list(st)
|
||||
letters = set()
|
||||
|
||||
i = 0
|
||||
|
||||
while i < len(st):
|
||||
if st[i] in letters:
|
||||
st.pop(i)
|
||||
else:
|
||||
letters.add(st[i])
|
||||
i += 1
|
||||
|
||||
return "".join(st)
|
||||
Reference in New Issue
Block a user