Remove Duplicate Letters for Lexicographically Smallest Result
Asked at ByteDance · Coding Questions · Difficulty: Medium · Last asked Jun 24, 2026
Given a string `s` of lowercase English letters, delete characters so that every distinct letter of `s` appears exactly once, keeping the remaining characters in their original relative order. Return the lexicographically smallest string that can be obtained this way.
Loading the problem…
More ByteDance interview questions
- Project Deep Dive (Resume Drill)
- Video-Keyword Association Review System
- Realtime Auction Bidding System
- MLE Oral Fundamentals: Dropout, Overfitting, Normalization, Loss Functions
- Content Moderation System Design
- ML System Design: Dynamic K in Retrieval Stage