• + 0 comments

    Python solution

    def utopianTree(n):
        cont = 0
        for i in range(n+1):
    
            if (i % 2) == 0:
                cont+=1
            else:
                cont*=2
        
        return cont