[Easy] LeetCode - no.637 Average of Levels in Binary Tree : Java
https://leetcode.com/problems/average-of-levels-in-binary-tree/?envType=study-plan-v2&envId=top-interview-150 문제이진 트리의 root가 주어졌을 때, 각 레벨별 평균을 구하여 반환할 것 Example 1 Input: root = [3,9,20,null,null,15,7]Output: [3.00000,14.50000,11.00000]Explanation: The average value of nodes on level 0 is 3, on level 1 is 14.5, and on level 2 is 11.Hence return [3, 14.5, 11]. 풀이참고 [LeetCode] 637. Average ..
2024. 10. 25.
[Easy] LeetCode - no.112 Path Sum : Java
https://leetcode.com/problems/path-sum/description/?envType=study-plan-v2&envId=top-interview-150 문제이진 트리의 root와 정수 targetSum이 주어졌을 때, 트리의 루트로부터 리프까지의 합이 targetSum과 일치하는지 여부를 판단할 것 Example 1 Input: root = [5,4,8,11,null,13,4,7,2,null,null,null,1], targetSum = 22Output: trueExplanation: The root-to-leaf path with the target sum is shown. 풀이참고 LeetCode 112(Path Sum, java)0. 문제 https://leetc..
2024. 10. 24.