wes d2a2ba9e15 first commit | 4 年 前 | |
---|---|---|
.. | ||
README.md | 4 年 前 | |
code.cpp | 4 年 前 | |
unitTest.cpp | 4 年 前 |
by Helen Yu tags: formatting, strings
Write a function to create a Christmas tree based on height h. Examples tree(1) ➞ [ "#" ] tree(2) ➞ [ " # ", "###" ] tree(5) ➞ [ " # ", " ### ", " ##### ", " ####### ", "#########" ] tree(0) ➞ [] Notes N/A
Write a function to create a Christmas tree based on height h
.
tree(1) ➞ [
"#"
]
tree(2) ➞ [
" # ",
"###"
]
tree(5) ➞ [
" # ",
" ### ",
" ##### ",
" ####### ",
"#########"
]
tree(0) ➞ []
N/A