Interesting Patterns
Submissions: 2676   Accuracy:

31.34%

  Difficulty: Basic   Marks: 1

Given an integer N. Your task is to print the pattern.
For example:
Input N=4 
Output : 
4444444 
4333334 
4322234 
4321234 
4322234 
4333334 
4444444 

Input N=3 
Output : 
 33333 
 32223 
 32123 
 32223 
 33333
 
Input:
First line consists of test cases.For each test case only one line be the input containing an integer N.

Output:
For each test case. Print the pattern in single line by giving space instead of new line.

Constraints:
1<=T<=20
1<=N<=20

Example:
Input

1
4

Output
4444444 4333334 4322234 4321234 4322234 4333334 4444444

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth
Author: saksham seth


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.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.