This commit is contained in:
2023-09-23 14:58:28 -04:00
parent 1e1e8f1f03
commit 385dafd1d1
3 changed files with 34 additions and 2 deletions

View File

@ -1,2 +1,15 @@
def remove_duplicate(string):
pass
last = ''
dups = ''
new_string = ''
for char in string:
if last == char:
dups += char
else:
new_string += char
last = char
return new_string, dups
print(remove_duplicate("balloons"))