Explanation

511.Print a Diamond Star Pattern

Easy
Given an integer n, return the 2n rows of a centered star diamond — a Full Star Pyramid (n rows, growing) immediately followed by a Reverse Star Pyramid (n rows, shrinking). The widest row (0 spaces, 2n − 1 stars) sits in the middle, appearing twice in a row: once as the last row of the top half, once as the first row of the bottom half. Both solutions build the two halves separately and concatenate them — reusing the exact row formulas from the Full Star Pyramid and Reverse Star Pyramid problems.

Example 1:

Input: n = 3

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

Example 2:

Input: n = 1

Output: ["*","*"]

+ 1 hidden test case run on Submit.

Constraints:

  • ●1 ≤ n ≤ 20

n =

3