wes d2a2ba9e15 first commit 4 years ago
..
README.md d2a2ba9e15 first commit 4 years ago
code.cpp d2a2ba9e15 first commit 4 years ago
unitTest.cpp d2a2ba9e15 first commit 4 years ago

README.md

Christmas Tree

by Helen Yu tags: formatting, strings

Summary

Write a function to create a Christmas tree based on height h. Examples tree(1) ➞ [ "#" ] tree(2) ➞ [ " # ", "###" ] tree(5) ➞ [ " # ", " ### ", " ##### ", " ####### ", "#########" ] tree(0) ➞ [] Notes N/A

Instructions

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

Examples

tree(1) ➞ [
  "#"
]

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

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

tree(0) ➞ []

Notes

N/A