| 
				
					 | 
			5 лет назад | |
|---|---|---|
| .. | ||
| README.md | 5 лет назад | |
| code.cpp | 5 лет назад | |
| unitTest.cpp | 5 лет назад | |
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