Skip to content

Commit ae927f5

Browse files
update 1676
1 parent fc38c9b commit ae927f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/main/java/com/fishercoder/solutions/_1676.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static class Solution2 {
4747
*/
4848
public TreeNode lowestCommonAncestor(TreeNode root, TreeNode[] nodes) {
4949
TreeNode ans = nodes[0];
50-
for (int i = 0; i < nodes.length; i++) {
50+
for (int i = 1; i < nodes.length; i++) {
5151
ans = lca(root, ans, nodes[i]);
5252
}
5353
return ans;

0 commit comments

Comments
 (0)