1
3 2
4 5 6
10 9 8 7
11 12 13 14 15
The first line contains a single integer ‘T’ denoting the number of test cases to be run. Then the test cases follow.
The first and only line of each test case contains an integer 'N' denoting the number of rows.
For each test case print the integers corresponding to the pattern in the next ‘N’ lines.
You are not required to print anything, it has already been taken care of. Just implement the function.
1 <= T <= 10
1 <= N <= 500
Time Limit : 1 sec
For the given input ‘N’, the pattern contains ‘N’ rows with the ith row containing ‘i’ number of elements, where 1 <= ‘i’ <= ‘N’. The numbers start from 1 and increase up to ‘N’ * (N + 1) / 2. We have to return ‘N’ lines in a specific pattern where the numbers in the odd rows are in increasing order, whereas the numbers in the even rows are in decreasing order.
Algorithm :
Number of Digits
Matrix Boundary Traversal
Star Triangle
Print Fibonacci Series
Print Fibonacci Series
Print Fibonacci Series
Print Fibonacci Series
Print Fibonacci Series
Print Fibonacci Series
Inverted Left Half Pyramid