Given a number, the task is to check if it is tidy or not. A tidy number is a number whose digits are in non-decreasing order.
Input : 1234 Output : Yes Input : 1243 Output : No Digits "4" and "3" violate the property.
The first line of input contains an integer T denoting the no of test cases. For each test case there will be single line containing an integer N.
For each test case in a new line print 1 if the no is a tidy number else print 0.
1 <= T <= 100
1 <= N <= 10^9+7
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.