You are viewing a single comment's thread. Return to all comments →
Python: def utopianTree(n): return 2**(n//2+1)-1 if n%2==0 else 2**(n//2+2)-2
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: def utopianTree(n): return 2**(n//2+1)-1 if n%2==0 else 2**(n//2+2)-2