You are given a string s and a robot equipped with an empty string t and an empty output string p.
The robot can perform either of the following two operations in any order until both s and t become empty:
Remove the first character from s and append it to the end of t.
Remove the last character from t and append it to the end of p.
Return the lexicographically smallest string p that can be produced.
Constraints:
s.length
s consists of only English lowercase letters.
You are given a string s and a robot equipped with an empty string t and an empty output string p.
The robot can perform either of the following two operations in any order until both s and t become empty:
Remove the first character from s and append it to the end of t.
Remove the last character from t and append it to the end of p.
Return the lexicographically smallest string p that can be produced.
Constraints:
s.length
s consists of only English lowercase letters.