Build a centred pyramid of n rows. Row i (counting from 1) contains 2*i - 1 stars,
with spaces on both sides so that every row is exactly 2*n - 1 characters wide.
Return the rows as a list of strings.
Examples
Input: n = 3
Output: [" * ", " *** ", "*****"]
Input: n = 1
Output: ["*"]
Constraints
0 <= n <= 40- Return
[]whennis0.
Goals
- Work out the number of stars and padding for each row from the row index
- Keep every row the same width so the pyramid is centred