We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7da55c commit b6d18b8Copy full SHA for b6d18b8
src/main/java/com/fishercoder/solutions/_236.java
@@ -24,14 +24,6 @@ For example, the lowest common ancestor (LCA) of nodes 5 and 1 is 3.
24
public class _236 {
25
public static class Solution1 {
26
27
- /**
28
- * We need to find TWO nodes in the tree,
29
- * so we'll have to divide and conquer this tree,
30
- * we need to have two nodes to as the intermediate result,
31
- * also, refer to my earlier drawings:http://www.fishercoder.com/2016/06/23/lowest-common-ancestor-of-a-binary-tree/
32
- * I'm really impressed with myself at that time!
33
- */
34
-
35
public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
36
if (root == null || root == p || root == q) {
37
return root;
0 commit comments