Number Diamond
Given an integer
N as input, write a program to print a number diamond of 2*N -1 rows as shown below.
Note: There is a space after each number.
Input
The first line of input is an integer
N.
Explanation
In the given example, the number of rows in the diamond is
5.
So, the output should be
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Sample Input 1
5
Sample Output 1
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Sample Input 2
4
Sample Output 2
1
1 2
1 2 3
1 2 3 4
1 2 3
1 2
1
Comments
Leave a comment