package leetcode;

/**
 * https://leetcode.com/problems/distribute-coins-in-binary-tree/
 */
public class Problem979 {
    public class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }
    }

    public int distributeCoins(TreeNode root) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem979 prob = new Problem979();
    }
}

@@ -119,24 +119,31 @@
 %0A    public 
+static 
 class TreeNo
@@ -453,16 +453,744 @@
 em979();
+%0A%0A        TreeNode root = new TreeNode(3);%0A        root.left = new TreeNode(0);%0A        root.right = new TreeNode(0);%0A        System.out.println(prob.distributeCoins(root)); // 2%0A%0A        root = new TreeNode(0);%0A        root.left = new TreeNode(3);%0A        root.right = new TreeNode(0);%0A        System.out.println(prob.distributeCoins(root)); // 3%0A%0A        root = new TreeNode(1);%0A        root.left = new TreeNode(0);%0A        root.right = new TreeNode(2);%0A        System.out.println(prob.distributeCoins(root)); // 2%0A%0A        root = new TreeNode(1);%0A        root.left = new TreeNode(0);%0A        root.left.right = new TreeNode(3);%0A        root.right = new TreeNode(0);%0A        System.out.println(prob.distributeCoins(root)); // 4
 %0A    %7D%0A%7D

Update problem 979