Problem
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.
Constraints
0 ≤ height ≤ 50
Examples
Example 1
Input:
height = 3
Expected output:
expected = [" #", " ##", "###"]
Input:
long long height = 3;
Expected output:
std::vector<std::string> expected = {" #", " ##", "###"};
Input:
long height = 3;
Expected output:
string[] expected = new string[] {" #", " ##", "###"};
Explanation
Rows are " #", " ##" and "###": each row has one more block and one less space.
Example 2
Input:
height = 1
Expected output:
expected = ["#"]
Input:
long long height = 1;
Expected output:
std::vector<std::string> expected = {"#"};
Input:
long height = 1;
Expected output:
string[] expected = new string[] {"#"};
Explanation
A single row with one block: "#".
References
This challenge is adapted for CodeUtility. Follow the statement and constraints above.