Given the root of a binary tree, return the sum of the tilts of all nodes in the tree.
The tilt of a single tree node is defined as the absolute difference between the sum of all node values in its left subtree and the sum of all node values in its right subtree. If a node lacks a left child, the sum of the left subtree values is treated as
Constraints:
The number of nodes in the tree is in the range
Node.val
Given the root of a binary tree, return the sum of the tilts of all nodes in the tree.
The tilt of a single tree node is defined as the absolute difference between the sum of all node values in its left subtree and the sum of all node values in its right subtree. If a node lacks a left child, the sum of the left subtree values is treated as
Constraints:
The number of nodes in the tree is in the range
Node.val