You are viewing a single comment's thread. Return to all comments →
def one_cycle(height_one): return (2*height_one +1)
def utopianTree(n): # Write your code here height=1
cycles=n//2 if cycles: for i in range (cycles): height=one_cycle(height) if n%2==0: return height else: return (2*height)
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Utopian Tree
You are viewing a single comment's thread. Return to all comments →
def one_cycle(height_one): return (2*height_one +1)
def utopianTree(n): # Write your code here height=1