remove_duplicates(s) that returns s with every repeated character removed, keeping only the first occurrence of each character and preserving the original order.s = 'programming'
'progamin'
Repeated letters (the second r, second m, second g) are dropped; first occurrences are kept in order.
s = 'aabbcc'
'abc'
Only the first a, first b and first c survive.
Track characters already seen in a set.
Append a character to the result only the first time you see it.