Created
December 11, 2017 09:33
-
-
Save johndavedecano/def097d4daf00ca56408a2be5bdae05a to your computer and use it in GitHub Desktop.
EXAMS - Asterisk Pyramid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function solution(height) { | |
var tree = []; | |
for (var i=0; i<5; i++) { | |
var child = "*"; | |
for(var s=0; s<i; s++) { | |
child = child + "*" | |
} | |
tree[i] = child; | |
} | |
return tree.join("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment