문제
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.
제약 조건
0 ≤ height ≤ 50
예시
예시 1
입력:
height = 3
예상 출력:
expected = [" #", " ##", "###"]
입력:
long long height = 3;
예상 출력:
std::vector<std::string> expected = {" #", " ##", "###"};
입력:
long height = 3;
예상 출력:
string[] expected = new string[] {" #", " ##", "###"};
설명
Rows are " #", " ##" and "###": each row has one more block and one less space.
예시 2
입력:
height = 1
예상 출력:
expected = ["#"]
입력:
long long height = 1;
예상 출력:
std::vector<std::string> expected = {"#"};
입력:
long height = 1;
예상 출력:
string[] expected = new string[] {"#"};
설명
A single row with one block: "#".
참고 자료
이 문제는 CodeUtility에 맞게 수정되었습니다. 위의 설명과 제한 조건을 따르세요.