Remove Duplicate Letters

Given a string s, remove duplicate letters so that each letter appears once and only once. The resulting string should be the smallest lexicographical order among all possible results.

Constraints

  • 1 <= s.length <= 10^4
  • s consists of lowercase English letters.
Auto-saved · 2 lines
class Solution:
def removeDuplicateLetters(self, s: str) -> str:
Console

Click Run to execute sample tests.