← 返回 amazon 的题目列表Lexicographically Smallest Reordering of Box ID String
类型:online_judge
amazon
The team is given a task to optimize the packing of a set of boxes with different IDs. Each box has an ID, and these boxes are arranged into a single string s. Find the lexicographically smallest string of boxes where the string is minimal, such that at every position where X and Y differ, Y is smaller than X. For example, if s_id = '26547', it gives the lexicographically smallest result as '24657'.
Example
Input
26547