Leetcode 993. Cousins in Binary Tree
Determine whether two given nodes in a binary tree are cousins — i.e., they have the same depth but different parents — by traversing the tree to find and compare each node's depth and parent.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.