993
-
[LeetCode] 993. Cousins in Binary TreeLeetCode 2021. 10. 18. 13:43
https://leetcode.com/problems/cousins-in-binary-tree/ Cousins in Binary Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Cousins in Binary Tree 이진 트리에서 주어진 두 수를 가진 노드들이 사촌관계인지 출력하는 문제이다. 사촌관계란, 루트 노드로부터 depth가 같아야하고, 부모가 서로 달라야한다. 풀이 방법은 루트부터 left, right 자식들을 훑으며 내려갈때마다 depth..