Sponsored
Use these hints if you're stuck. Try solving on your own first.
Traverse the graph visiting root, left, root, right, root to make an Euler Path
Return the node (LCA) that is at the lowest depth between p and q in the Euler Path
Solve with full IDE support and test cases