If not same , then find the larger of two and go in the direction of larger value
elif ( L [ i - 1 ] [ j ] > L [ i ] [ j - 1 ] ) : NEW_LINE INDENT i -= 1 NEW_LINE DEDENT else : NEW_LINE INDENT j -= 1 NEW_LINE DEDENT ans = " " NEW_LINE for x in range ( len ( lcs ) ) : NEW_LINE ans += lcs [ x ] NEW_LINE return ans NEW_LINE