Join Regular Classroom : Visit ClassroomTech

Coding Weekly Challenge

He leaves a hint for you.

He needs the following output for the inputs 2, 3, 4, 5,….. respectively.

Input: 2
Output:
2 2 2
2 1 2
2 2 2

Input: 3
Output:
3 3 3 3 3
3 2 2 2 3
3 2 1 2 3
3 2 2 2 3
3 3 3 3 3

Input: 4
Output:
4 4 4 4 4 4 4
4 3 3 3 3 3 4
4 3 2 2 2 3 4
4 3 2 1 2 3 4
4 3 2 2 2 3 4
4 3 3 3 3 3 4
4 4 4 4 4 4 4

Input: 5
5 5 5 5 5 5 5 5 5
5 4 4 4 4 4 4 4 5
5 4 3 3 3 3 3 4 5
5 4 3 2 2 2 3 4 5
5 4 3 2 1 2 3 4 5
5 4 3 2 2 2 3 4 5
5 4 3 3 3 3 3 4 5
5 4 4 4 4 4 4 4 5
5 5 5 5 5 5 5 5 5

You as a coder can contribute code in any of the following programming languages C, C++, JAVA, Python.

Contribute code to codewindowauthor@gmail.com . We will check your code and we will publish your code with your name as Contributor. Thank you.
Upload your code along with .c file, .cpp file, .java file or .py file.
Mention your name.

Thank you.