Available question text
Given a lowercase string s, repeatedly perform rounds where you remove the first occurrence of each letter 'a' to 'z' (if present) until s becomes empty; return the string state immediately before the final round. The challenge is to determine which characters survive all but the last pass efficiently for s up to 5e5 in length.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3039. Apply Operations to Make String Empty
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source