# Tree example:
#       10
#      /  \
#     5   15
#    / \    \
#   3   7   20


class Node:
    def __init__(self, value, left=None, right=None):
        self.value = value
        self.left: Node | None = left
        self.right: Node | None = right


root_node = Node(10)
root_node.left = Node(5)
root_node.left.left = Node(3)
root_node.left.right = Node(7)
root_node.right = Node(15)
root_node.right.right = Node(20)


def find_depth(root: Node | None, subtree_depth=0) -> int:
    if root is None:
        return subtree_depth

    left_depth = find_depth(root.left, subtree_depth + 1)
    right_depth = find_depth(root.right, subtree_depth + 1)
    return max(left_depth, right_depth)


print(find_depth(root_node))

root_node.right.right.right = Node(1)
print("After adding another level:", find_depth(root_node))
