Tree: Height of a Binary Tree

  • + 0 comments

    one liner using your logic

    return -1 if root is None else max(height(root.left) + 1, height(root.right) + 1)