boolean prune(TreeNode x) {
        if (x == null)
            return true;
        boolean l = prune(x.left);
        boolean r = prune(x.right);
        if (l)
            x.left = null;
        if (r)
            x.right = null;
        return x.val == 0 && x.right == null && x.left == null;
    }
Why Did you create this class? what does it do?
src/problems/medium/BinaryTreePruning.java