You are viewing a single comment's thread. Return to all comments →
JAVA 8
public static int utopianTree(int n) { int count=1; for(int i=0; i<n; i++) { if(count%2==1) { count*=2; } else { count++; } } return count; }
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 →
JAVA 8