100-days-of-rust/Week-07/Day-48_Christmas-Tree/README.md

25 lines
272 B
Markdown
Raw Normal View History

2023-03-24 01:14:34 +00:00
# Christmas Tree
Write a function to create a Christmas tree based on height **h**.
## Examples
```text
tree(1) ➞ [
"#"
]
tree(2) ➞ [
" # ",
"###"
]
tree(5) ➞ [
" # ",
" ### ",
" ##### ",
" ####### ",
"#########"
]
tree(0) ➞ []
```