Question: Input: The input is a string s consisting of 1, 2, and 3. (1112321;121321>112231;121321->112312; Note: Adjacent 1 and 3 cannot be exchanged. Output the smallest

 Input: The input is a string s consisting of "1", "2",

and "3". (1112321;121321>112231;121321->112312; Note: Adjacent "1" and "3" cannot be exchanged. Output

Input: The input is a string s consisting of "1", "2", and "3". (1112321;121321>112231;121321->112312; Note: Adjacent "1" and "3" cannot be exchanged. Output the smallest lexicographical string that can be obtained after performing the above operations any number of times (can be 0 times)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!