Posts by José Tomaz • 1 point
1 post
-
-1
votes6
answers4637
viewsA: Dual in function and for
function alturaArvoreUtopica(qtdCiclo){ var arvore = 1 for(var i = 0; i < qtdCiclo; i++){ if(i % 2){ arvore += 1; }else{ arvore *= 2; } } return arvore } Assuming: The tree starts with 1 meter;…
javascriptanswered José Tomaz 1