Leetcode 2434. Using a Robot to Print the Lexicographically Smallest String
Given a string s and an empty buffer t that acts like a stack (you can push s's first char onto t or pop t's last char to output), produce the lexicographically smallest string printable by a sequence of these operations. The core challenge is a greedy stack simulation: decide when to push vs. pop using the smallest remaining character in s (maintain counts) to minimize the output.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.