← Questions

Siblings, cousins or neither: two nodes in a tree

0
AmazonCodingLast asked Apr 2026

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

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding