Explanation

507.Print a Number Increasing Reverse Pyramid

Easy
Given an integer n, return the n rows of an upside-down centered number pyramid — row i has (i − 1) leading spaces, followed by the numbers 1 through (n − i + 1). This is the Number Increasing Pyramid, flipped: the widest row (1 through n, no spaces) comes first, narrowing by one number — and gaining one leading space — each row after. Both solutions carry over the Number Increasing Pyramid's technique directly, just with (i − 1) and (n − i + 1) swapped in for the space and number counts.

Example 1:

Input: n = 3

Output: ["1 2 3"," 1 2"," 1"]

Example 2:

Input: n = 1

Output: ["1"]

+ 1 hidden test case run on Submit.

Constraints:

  • ●1 ≤ n ≤ 9

n =

3