Back to Question

Remove Duplicate Letters

Question Explain

Given a string `s`, remove duplicate letters so that every letter appears once and only once. The result must be the smallest in lexical order among all possible results. Use a Monotonic Stack.

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.