Cousins in Binary Tree
Easy
Binary Trees
Two nodes are cousins if they are at the same depth but have different parents. Given values x and y, print true if they are cousins, otherwise false.
Constraints
2 <= number of nodes <= 100 All values are unique
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.