```
public int findTilt(TreeNode root) {
if(root == null) return 0;
return findTilt(root.left) + findTilt(root.right) + Math.abs(nodeSum(root.left) - nodeSum(root.right));
}
//nodeSum is defined as the the sum of all the node's children and the node itself
public int nodeSum(TreeNode node){
if(node == null) return 0;
return node.val + nodeSum(node.left) + nodeSum(node.right);
}
}
```