Skip to content

Instantly share code, notes, and snippets.

@johndavedecano
Created December 11, 2017 09:33
Show Gist options
  • Save johndavedecano/def097d4daf00ca56408a2be5bdae05a to your computer and use it in GitHub Desktop.
Save johndavedecano/def097d4daf00ca56408a2be5bdae05a to your computer and use it in GitHub Desktop.
EXAMS - Asterisk Pyramid
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