hard? - accepted / - tried
Given a string which, write a function to remove the duplicate characters to make sure that each character only occurs once.
Each character appears twice, we could make it unique as follows
'xyzabc' 'xyabcz' 'xabcyz' 'abcxyz' 'abxyzc' .....
substrings subsequences (*) contains unique characters, but you need to return the smallest one in lexicographical order( 'a' -> 'z'), which is
All input only contains valid lowercase alphabets only.
Let's try to solve this problem within 10 mintues.