We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functionutopianTree($n){// Write your code here$height=1;for($i=1;$i<=$n;$i++){// is summerif($i%2==0){$height+=1;}else{// is spring$height*=2;}}return$height;}
Cookie support is required to access HackerRank
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 →
Php solution;