Siblings, cousins or neither: two nodes in a tree

0
Remix

Given a tree and two of its nodes, say whether they are siblings (same parent), cousins (same depth, different parents) or neither.

AmazonTechnical phone screenLast asked Apr 2026
No answer yet. Write the first one; the best answer gets endorsed.