로딩
요청 처리 중입니다...

JAVA_Binary Tree Tilt_LeetCode 563

 JAVA_Binary Tree Tilt_LeetCode 563

JAVA_Binary Tree Tilt_LeetCode 563 풀이 class Solution { int findSum(TreeNode root){ if(root==null) return 0; return root.val + findSum(root.left) + findSum(root.right); } public int findTilt(TreeNode root) { if(root==null) return 0; int left = findTilt(root.left); int right = findTilt(root.right); return Math.abs(findSum(root.left)-findSum(root.right))+left+right; } } * 출처 Binary Tree Tilt - LeetCode Binary Tree Tilt - Given the root of a binary tree, return the sum of every tree node's tilt. The...

# BinaryTreeTilt_LeetCode563 # JAVA # JAVA_BinaryTreeTilt # JAVA_BinaryTreeTilt_LeetCode563 # JAVA_LeetCode563