package leetcode;

/**
 * https://leetcode.com/problems/count-good-nodes-in-binary-tree/
 */
public class Problem1448 {
    public static class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode() {
        }

        TreeNode(int val) {
            this.val = val;
        }

        TreeNode(int val, TreeNode left, TreeNode right) {
            this.val = val;
            this.left = left;
            this.right = right;
        }
    }

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

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

@@ -651,16 +651,528 @@
 m1448();
+%0A%0A        TreeNode root = new TreeNode(3);%0A        root.left = new TreeNode(1);%0A        root.left.left = new TreeNode(3);%0A        root.right = new TreeNode(4);%0A        System.out.println(prob.goodNodes(root)); // 4%0A%0A        root = new TreeNode(3);%0A        root.left = new TreeNode(3);%0A        root.left.left = new TreeNode(4);%0A        root.left.right = new TreeNode(2);%0A        System.out.println(prob.goodNodes(root)); // 3%0A%0A        root = new TreeNode(1);%0A        System.out.println(prob.goodNodes(root)); // 1
 %0A    %7D%0A%7D

Update problem 1448