• + 0 comments
    def utopianTree(n):
        height = 1
        if n > 0:
            for period in range(1, n+1):
                if period % 2 == 1:
                    height *= 2
                else:
                    height += 1
        return height