Remove duplicate letters to form lexicographically smallest string
Filed under UBS
The question
Given a string s, remove duplicate letters so that every letter appears once and only once in the lexicographically smallest possible order.
No write-up yet. Related questions below have one.
Related UBS questions
Collected from public candidate posts and coding forums. Updated Nov 2026.