Finding the node closest to the root which is not the common ancestor of u and v i . e . a node x such that x is not the common ancestor of u and v but lca [ x ] [ 0 ] is
for i in range ( log - 1 , - 1 , - 1 ) : NEW_LINE INDENT if ( lca [ v ] [ i ] != lca [ u ] [ i ] ) : NEW_LINE DEDENT