Problem title
Difficulty
Avg time to solve

Largest sub-tree sum
Easy
15 mins
Reversing Series Pattern
Easy
15 mins
Equal Sum
Easy
15 mins
Pattern: Triangle of numbers
Easy
15 mins
Binary Confusion
Easy
10 mins
Minimum Falling Path Sum
Moderate
25 mins
Ways to Arrange Balls
Hard
40 mins
Longest Palindromic Subsequence
Hard
45 mins
Find prime numbers
Easy
15 mins
Minimum Character Deletion
Moderate
15 mins
9

Reversing Series Pattern

Difficulty: EASY
Contributed By
Avg. time to solve
15 min
Success Rate
85%

Problem Statement

You are given an integer ‘N’. Your task is to return a reverse series pattern for the given ‘N’.

The reverse series pattern for ‘N’ = 5 will look like following:

1 
3 2 
4 5 6 
10 9 8 7 
11 12 13 14 15
Input Format :
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.
Output format :
For each test case print the integers corresponding to the pattern in the next ‘N’ lines.
Note
You are not required to print anything, it has already been taken care of. Just implement the function.
Constraints :
1 <= T <= 10
1 <= N <= 500

Time Limit : 1 sec
Sample Input 1 :
2
7
6
Sample Output 1 :
1
3 2
4 5 6
10 9 8 7
11 12 13 14 15
21 20 19 18 17 16
22 23 24 25 26 27 28
1
3 2
4 5 6
10 9 8 7
11 12 13 14 15
21 20 19 18 17 16 
Sample Input 2 :
2
3
4
Sample Output 2 :
1
3 2
4 5 6
1
3 2
4 5 6 
10 9 8 7
Reset Code
Full screen
copy-code
Console