Cousins in Binary Tree (LeetCode 993)

Goal

Check if two nodes are same depth but different parents.

Approach

BFS track parent+depth for x and y; compare once both found.

Tip

One pass BFS is enough — store two (parent, depth) pairs.

Review BFS family checks via real-time interview help.