본문 바로가기 메뉴 바로가기

즐망노트

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

즐망노트

검색하기 폼
  • 분류 전체보기 (30)
    • 코딩테스트 (19)
      • LeetCode (9)
      • BOJ (10)
    • Archive (3)
      • GitLab (2)
      • Elasticsearch (1)
    • Project (0)
      • Laravel 11 (0)
    • Area (1)
      • 육아 (1)
  • 방명록

자바 Count Good Nodes in Binary Tree (1)
Count Good Nodes in Binary Tree

문제 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
이전 1 다음
이전 다음
반응형

Blog is powered by Tistory / Designed by Tistory

티스토리툴바