you give ternary string string consist character 0 1 2you swap adjacent consecutive character 0 1 ie replace 01 10 vice versa adjacent consecutive character 1 2 ie replace 12 21 vice versaFor example string 010210 perform follow move 010210 rightarrow 100210 010210 rightarrow 001210 010210 rightarrow 010120 010210 rightarrow 010201 note swap 02 rightarrow 20 vice versa you perform operation give string exclude describe aboveyou task obtain minimum possible lexicographically string swap arbitrary number time possibly zerostre lexicographically stre b string b length exist position 1 le le s length string s j hold a_j b_j a_i b_i