Problema
Draw a right-aligned pyramid like the one in Super Mario: row i (counting from 1) has height − i spaces followed by i # characters.
Implement pyramid_rows(height).
Input
height: The number of rows.
Output
Return the rows from top to bottom.
Restrições
0 ≤ height ≤ 50
Exemplos
Exemplo 1
Entrada:
height = 3
Saída esperada:
expected = [" #", " ##", "###"]
Entrada:
long long height = 3;
Saída esperada:
std::vector<std::string> expected = {" #", " ##", "###"};
Entrada:
long height = 3;
Saída esperada:
string[] expected = new string[] {" #", " ##", "###"};
Explicação
Rows are " #", " ##" and "###": each row has one more block and one less space.
Exemplo 2
Entrada:
height = 1
Saída esperada:
expected = ["#"]
Entrada:
long long height = 1;
Saída esperada:
std::vector<std::string> expected = {"#"};
Entrada:
long height = 1;
Saída esperada:
string[] expected = new string[] {"#"};
Explicação
A single row with one block: "#".
Referências
Este desafio foi adaptado para o CodeUtility. Siga o enunciado e as restrições acima.