You are viewing a single comment's thread. Return to all comments →
Python Solution
def utopianTree(n): out = [] for i in range(n+1): if i==0: out.append(1) elif i%2==0 and i!=0: out.append(out[-1]+1) else: out.append(out[-1]*2) return out[n]
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 →
Python Solution