I don't quite understand this sentence. "You must make sure your result is the smallest in lexicographical order among all possible results.", Can anyone give more examples about this?
This might help: Lexicographically minimal string rotation
The formal definition is given at here. For simplicity, you can understand the lexicographical order as the order used in a dictionary.
a < aa < aaa < ab < abb < abc < b < bcd < be < ...
What the question means is that you can't change their relative position, and under such condition, you have to make sure your result is the smallest in lexicographical order. If you don't need to keep their relative position, the .sort() function can solve it. But unfortunately, it doesn't work.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.