how to convert a string into a palindrome with minimum number of operations?
问题 Here is the problem states to convert a string into a palindrome with minimum number of operations. I know it is similar to the Levenshtein distance but I can't solve it yet For example, for input mohammadsajjadhossain , the output is 8 . 回答1: Perform Levenshtein distance on the string and its reverse. The solution will be the minimum of the operations in the diagonal of the DP array going from bottom-left to top-right, as well as each entry just above and just below the diagonal. This works