P15299 [GeeksforGeeks] Print this pattern0709
普及-
题目描述

Given an integer N, you need to print the following pattern.
Example 1:
Input:
N = 3
Output:
33333
32223
32123
32223
33333
Explanation:
When N = 3 then there will be three boundaries.
Outer boundary contains only 3.
Middle boundary contains only 2.
And the inner boundary contains only 1.
Example 2:
Input:
N = 4
Output:
4444444
4333334
4322234
4321234
4322234
4333334
4444444
Your Task:
You don't need to read input. Your task is to complete the function printPattern() which takes an integer N as an input parameter and print the pattern for it.
Expected Time Complexity: O(N^{2})
Expected Auxiliary Space: O(1)
Constraints:
1 <= N <= 9

输入格式

见题面

输出格式

见题面

样例输入
N = 3
样例输出
33333 32223 32123 32223 33333