@@ -0,0 +1,844 @@
+import java.util.Stack;%0A%0Apublic class _0236LowestCommonAncestorOfABinaryTree %7B%0A  TreeNode res = null;%0A%0A  public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) %7B%0A    find(root, p, q);%0A    return res;%0A  %7D%0A%0A  private int find(TreeNode node, TreeNode p, TreeNode q) %7B%0A    int num = 0;%0A    if (node.val == p.val %7C%7C node.val == q.val) %7B%0A      num++;%0A    %7D%0A    if (node.left != null) %7B%0A      num += find(node.left, p, q);%0A      if (num == 2 && res == null) %7B%0A        res = node;%0A        return num;%0A      %7D%0A    %7D%0A    if (num != 2 && node.right != null) %7B%0A      num += find(node.right, p, q);%0A      if (num == 2 && res == null) %7B%0A        res = node;%0A        return num;%0A      %7D%0A    %7D%0A    return num;%0A  %7D%0A%0A  public class TreeNode %7B%0A      int val;%0A      TreeNode left;%0A      TreeNode right;%0A      TreeNode(int x) %7B val = x; %7D%0A  %7D%0A%7D%0A

Add _0236LowestCommonAncestorOfABinaryTree