533.Print a Mirrored Number Triangle
Easy
Given
n (at most 9), return the mirror image of the Increasing Number Triangle: n right-aligned rows where row i shows the digits from i down to 1.
A mirror imageMirror ImageThe shape flipped left-to-right: what was on the left is now on the right, and sequences read in reverse. flips two things at once — the row moves to the right edge (leading spaces) and its contents read backwards. Because the total width is always n, the rows line up on the right.
Example 1:
Input: n = 4
Output: [" 1"," 21"," 321","4321"]
Example 2:
Input: n = 2
Output: [" 1","21"]
+ 4 hidden test cases run on Submit.
Constraints:
- ●
1 ≤ n ≤ 9
n =
4