You are viewing a single comment's thread. Return to all comments →
Here's my Java 8 code:
public static int utopianTree(int n) {
// Write your code here int height=1; for (int i=1; i<=n; i++){ if (i % 2==0) height+=1; else height*=2; } return height; }
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 →
Here's my Java 8 code:
public static int utopianTree(int n) {