wes d2a2ba9e15 first commit | 4 gadi atpakaļ | |
---|---|---|
.. | ||
README.md | 4 gadi atpakaļ | |
code.cpp | 4 gadi atpakaļ | |
unitTest.cpp | 4 gadi atpakaļ |
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