499.Print a Reverse Right Half Pyramid Star Pattern
Easy
Given an integer
n, return the n rows of an upside-down left-aligned star pyramid — row i has (n − i + 1) stars, shrinking one star per row.
This is the Right Half Pyramid, flipped: instead of growing from 1 star to n, it shrinks from n stars down to 1. Both solutions carry the exact same technique over — just with (n − i + 1) in place of i wherever the row length is needed.
Example 1:
Input: n = 4
Output: ["****","***","**","*"]
Example 2:
Input: n = 1
Output: ["*"]
+ 1 hidden test case run on Submit.
Constraints:
- ●
1 ≤ n ≤ 20
n =
4