22. Remove Duplicate Letters
smallest-subsequence-of-distinct-characters
Given a string s
, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicographical order among all possible results.
Example 1:
Example 2:
Solution: (Using Stack)
Last updated