If equal , then add the character to res string
if ( X [ i - 1 ] == Y [ j - 1 ] ) : NEW_LINE INDENT res = X [ i - 1 ] + res NEW_LINE i -= 1 NEW_LINE j -= 1 NEW_LINE len1 -= 1 NEW_LINE DEDENT else : NEW_LINE INDENT i -= 1 NEW_LINE DEDENT