Given a number N. The task is to print all the numbers less than or equal to N in increasing order, with the fact that absolute difference between any adjacent digits of number should be 1.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer N.
In new line print all the required numbers. if there is no such number less than or equal to N then print "-1".
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.