100-days-of-rust/Week-07/Day-48_Christmas-Tree/README.md
2023-03-23 21:14:34 -04:00

272 B

Christmas Tree

Write a function to create a Christmas tree based on height h.

Examples

tree(1) ➞ [
  "#"
]

tree(2) ➞ [
  " # ",
  "###"
]

tree(5) ➞ [
  "    #    ",
  "   ###   ",
  "  #####  ",
  " ####### ",
  "#########"
]

tree(0) ➞ []