Explanation

526.Print a Rhombus Star Pattern

Easy
Given n, return n rows that form a rhombus (a slanted square): every row has exactly n stars, and row i is shifted right by n − i spaces. This pattern isolates one idea: leading spacesLeading SpacesSpaces printed before the first visible character to shift a row to the right. alone can change the shape. The star count never changes from row to row — compare it with the Full Star Pyramid, where both the spaces and the stars change.

Example 1:

Input: n = 4

Output: [" ****"," ****"," ****","****"]

Example 2:

Input: n = 1

Output: ["*"]

+ 4 hidden test cases run on Submit.

Constraints:

  • ●1 ≤ n ≤ 20

n =

4