• + 0 comments

    Python 3 solution

    python def getHeight(self,root):

        if root.left:
            left = self.getHeight(root.left) + 1
        else:
            left = 0
        if root.right:
            right =self.getHeight(root.right) +1
        else:
            right = 0
    
        return max(left, right)