

1
23
4567
89123456
The first line contains ‘T’, denoting the number of test cases.
Each test case contains a single integer ‘N’, denoting the number of rows.
For each test case, print 'N' lines denoting the required pattern.
1 <= T <= 5
1 <= N <= 15
Where ‘T’ denotes number of test cases and ‘N’ is the given integer denoting the given number of rows.
Time Limit: 1 sec
The key here is to traverse all the lines sequentially, and for each line, we print the required character at the given index.
The steps are as follows: