You are viewing a single comment's thread. Return to all comments →
Javascript solution: Loop until the n finding the Even numbers and multiply the current tree height by 2 else add 1 for the tree height
// Write your code here let s = 1 for(let i =0; i<n; i++){ if(i%2 == 0) s *= 2 else s+= 1 } return s
Seems like cookies are disabled on this browser, please enable them to open this website
Utopian Tree
You are viewing a single comment's thread. Return to all comments →
Javascript solution: Loop until the n finding the Even numbers and multiply the current tree height by 2 else add 1 for the tree height