973. Pattern 22
Given an integer n. You need to recreate the pattern given below for any value of N. Let's say for N = 5, the pattern should look like as below:
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
Print the pattern in the function given to you.
Example 1:
Input: n = 4
Output:

Example 2:
Input: n = 2
Output:

Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 1 <= n <= 100