


A binary string is a string in which all characters are either ‘1’ or ‘0’.
The order is not strictly decreasing.
The first line contains an integer 'T' which denotes the number of test cases or queries to be run.
The first line of each test case contains a single integer ‘N’ denoting the size of the given string.
The second line of each test case contains the string ‘S’.
For each test case, If it is possible to sort the string in decreasing order, then print “true”, otherwise print “false”.
The output of each test case will be printed in a separate line.
You do not need to input or print anything, as it has already been taken care of. Just implement the given function.
1 <= T <= 5
1 <= N <= 10 ^ 4
Where ‘T’ is the total number of test cases and ‘N’ is the size of the given string.
Time limit: 1 sec
The idea here is to use the fact that while traversing from the end if we encounter 2 consecutive 1s then we can sort the string in decreasing order if and only if after the index which we have found 2 consecutive 1s we have-