End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
nodesFound as False.null, return null.p or q.p or q is found in the left or right subtree, set nodesFound to True.nodesFound is True, return the LCA; otherwise, return null.