Input : n = 200 Output : 199 If the given number is 200, the largest number which is smaller or equal to it having digits in non decreasing order is 199. Input : n = 139 Output : 139
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contain an integer N.
For each test case in a new line print the required output.
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.