
문제 https://leetcode.com/problems/count-good-nodes-in-binary-tree/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 풀이 코드 DFS로 Tree를 순회한다. 각 Node의 값이 순회 경로 상에 있는 Node들의 최댓값보다 크면 최댓값을 변경하고 answer를 1 증가한다. Tree를 모두 ..
코딩테스트/LeetCode
2023. 10. 6. 22:08
반응형