Practice Remove Duplicate Letters
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
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: Constraints: Note: This question is the same as 1081: https://leetcode.com/problems/smallest-subsequence-of-distinct-characters/
Source: Remove Duplicate Letters on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
s = "bcabc"
"abc"
# Example 2
s = "cbacdcbc"
"acdb"
Constraints
Related LeetCode Problems
Practice more problems similar to Remove Duplicate Letters.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.