You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #19 on September 15, 2026 10:58.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem link
https://leetcode.com/problems/binary-tree-tilt/
Problem Summary
이진트리에서 모든 노드의 tilt 값의 합을 구하는 문제.
tilt는 자신 왼쪽 서브트리의 합과 오른쪽 서브트리의 합의 절대값 차이다.
Solution
그냥 재귀적으로 tilt를 계속 구해주면 된다.
노드의 합 + 노드의 tilt 해서 2개를 배열로 관리해주며 돌려준다.
Source Code
All reactions