25 lines
272 B
Markdown
25 lines
272 B
Markdown
# Christmas Tree
|
|
|
|
Write a function to create a Christmas tree based on height **h**.
|
|
|
|
## Examples
|
|
```text
|
|
tree(1) ➞ [
|
|
"#"
|
|
]
|
|
|
|
tree(2) ➞ [
|
|
" # ",
|
|
"###"
|
|
]
|
|
|
|
tree(5) ➞ [
|
|
" # ",
|
|
" ### ",
|
|
" ##### ",
|
|
" ####### ",
|
|
"#########"
|
|
]
|
|
|
|
tree(0) ➞ []
|
|
``` |