# Challenge \#7: π Decorating the tree MEDIUM Itβs time to decorate the **Christmas tree** π! Write a function that receives: - `height` β the height of the tree (number of rows). - `ornament` β the ornament character (for example, `"o"` or `"@"`). - `frequency` β how often (in asterisk positions) the ornament appears. The tree is drawn with asterisks `*`, but **every `frequency` positions**, the asterisk is replaced by the ornament. The position counting starts at 1, from the top to the bottom, left to right. If `frequency` is 2, the ornaments appear in positions 2, 4, 6, etc. The tree must be centered and have a one-line trunk `#` at the end. ## π§© Examples ```javascript drawTree(5, 'o', 2) // * // o*o // *o*o* // o*o*o*o // *o*o*o*o* // # drawTree(3, '@', 3) // * // *@* // *@**@ // # drawTree(4, '+', 1) // + // +++ // +++++ // +++++++ // # ```
Your battle is waiting in the queue. It will start automatically when a slot becomes available.