📅  最后修改于: 2022-03-11 15:01:42.186000             🧑  作者: Mango
// 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;
}