← 返回 meta 的题目列表Lexicographically Smallest String from Reversal
类型:online_judge
Given a string word, you can reverse the order of some characters from the beginning or from the end of word to get new strings. Your task is to iterate over all possible new strings that can be formed this way, and return the alphabetically smallest one.
Example
Input
cba