wes d2a2ba9e15 first commit | 4 years ago | |
---|---|---|
.. | ||
README.md | 4 years ago | |
code.cpp | 4 years ago | |
unitTest.cpp | 4 years ago |
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