Remove letters from s so that every letter that appears in s appears exactly once, keeping the original relative order. Among all possible results return the one that is smallest in dictionary order.
For "bcabc" the answer is "abc"; for "cbacdcbc" it is "acdb".
Example 1
Input:
remove_duplicate_letters('bcabc')
Output:
'abc'
Example 2
Input:
remove_duplicate_letters('cbacdcbc')
Output:
'acdb'
0 <= len(s) <= 200000No results yet
Run your code to check it against the examples, or submit to run every test.