Search
⌘K

Leetcode 563. Binary Tree Tilt

Compute the sum of every node's tilt in a binary tree, where a node's tilt is the absolute difference between the sum of values in its left and right subtrees. This is solved by a post-order traversal that returns subtree sums and accumulates each node's absolute difference (one-pass O(n) solution).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.