Mistake : Forgetting to handle the case where one node is an ancestor of the other. If is an ancestor of , then . Mistake : Using up[u][i] = up[v][i] as the stopping condition when climbing together.
This overshoots the LCA. Stop when up[u][i] == up[v][i]. Mistake : Not accounting for -indexing vs -indexing. If nodes are -indexed, adjust your table and array so.