Given the root of a binary tree, return the sum of every tree node's tilt.
The tilt of a tree node is the absolute difference between the sum of all left subtree node values and all right subtree node values. If a node does not have a left child, then the sum of the left subtree node values is treated as 0. The rule is similar if there the node does not have a right child.
0:00 Explaining the Binary Tree Tilt Problem
4:59 Coding the solution
Download
0 formats
No download links available.
Binary Tree Tilt LeetCode 563 Solution using Depth First Search | NatokHD