This is a verified interview question from Zomato. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Lexicographically Smallest String - Zomato OA" covers key patterns like Strings.
"### Problem You are given an string $s$. You are also given two strings $t$ and $u$ which are both initially empty. You can perform either of the two operations in a turn: * Append the first character of $s$ to the end of $t$. * Append the last character of $t$ to the end of $u$. You need to apply these operations such that all the end all the characters from $s$ are shifted to $u$, and the generated string $u$ is the lexicographically smallest possible. Return the lexicographically smallest string $u$ that can be generated."
Join thousands of developers practicing for Zomato.