Flip Sorting
Chef has a binary string S of length N . Chef can perform the following operation on S any number of times (possibly zero): Choose a number X ( 1 ≤ X ≤ N ) that hasn't been chosen in any previous operation and flip any substring of S having length X (i.e. change all 0 s to 1 s and all 1 s to 0 s in any substring of S having length X ). Chef wants to sort S in non-decreasing order using any sequence of operations. Can you help Chef find such a sequence of operations? If there are multiple answers, print any. Input Format The first line contains a single integer T - the number of test cases. Then the test cases follow. The first line of each test case contains an integer N - the length of the binary string S . The second line of each test case contains a binary string S of length N containing 0 s and 1 s only. ...