Keep moving forward until no intersection is found
if ( i == j and path1 [ i ] == path2 [ j ] ) : NEW_LINE INDENT i = i + 1 NEW_LINE j = j + 1 NEW_LINE DEDENT else : NEW_LINE INDENT intersection = j - 1 NEW_LINE break NEW_LINE DEDENT sum = 0 NEW_LINE i = len ( path1 ) - 1 NEW_LINE