Utopian Tree hackerrank solution in javascript
// Utopian Tree hackerrank solution in javascript
function utopianTree(n) {
// Write your code here
let cycle = 1;
let height = 1;
for(cycle; cycle<=n; cycle++){
if(cycle %2 !== 0){
height *= 2;
}else{
height++;
}
}
return height;
}