• + 0 comments

    Python 3:

    def getHeight(self, root) -> int:
    		#Write your code here        
    		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)