Build an ASCII Tower

Imagine printing a small ASCII tower directly in the console. Write tower_builder, which builds a tower with n floors and returns it as a list of strings from top to bottom. Each lower floor has two more * characters than the one above it, with spaces on the sides so the tower stays centered.

Примеры

Ввод
1
Вывод
["*"]
Ввод
2
Вывод
[" * ", "***"]
Ввод
3
Вывод
[" * ", " *** ", "*****"]

Нужно реализовать

def tower_builder(n: int) -> list[str]:

Теги

stringslists
PostgreSQLv16

Le résultat de l'exécution du code s'affichera ici

Visible tests
1
Input
1
Expected["*"]
2
Input
2
Expected[" * ","***"]
3
Input
3
Expected[" * "," *** ","*****"]
4
Input
4
Expected[" * "," *** "," ***** ","*******"]
5
Input
6
Expected[" * "," *** "," ***** "," ******* "," ********* ","***********"]
6
Input
10
Expected[" * "," *** "," ***** "," ******* "," ********* "," *********** "," ************* "," *************** "," ***************** ","*******************"]
Focus radio
Paused · SomaFM · Fluid