@@ -0,0 +1,779 @@
+package leetcode;%0A%0A/**%0A * https://leetcode.com/problems/binary-tree-tilt/%0A */%0Apublic class Problem563 %7B%0A    public static class TreeNode %7B%0A        int val;%0A        TreeNode left;%0A        TreeNode right;%0A%0A        TreeNode(int x) %7B%0A            val = x;%0A        %7D%0A    %7D%0A%0A    public int findTilt(TreeNode root) %7B%0A        Tilt tilt = new Tilt();%0A        findTilt(root, tilt);%0A        return tilt.value;%0A    %7D%0A%0A    private static class Tilt %7B%0A        private int value;%0A    %7D%0A%0A    private static int findTilt(TreeNode node, Tilt tilt) %7B%0A        if (node == null) %7B%0A            return 0;%0A        %7D%0A        int left = findTilt(node.left, tilt);%0A        int right = findTilt(node.right, tilt);%0A        tilt.value += Math.abs(left - right);%0A        return left + right + node.val;%0A    %7D%0A%7D%0A

Solve problem 563