Ideas:
Given a string, two non-overlapping strings are obtained. They flip and complement each other. One of the strings can be the original string substrings that can be deleted up to two characters.
Due to the ability to delete sub-strings in dynamic planning, I first thought of the LCS problem, but I need to enumerate all the lengths. The complexity is O (n ^ 3) and cannot be obtained.
Due to the linear increase in length, the length of binary search is considered. The complexity is O (n ^ 2 * log (n )).
You need to search twice to find that the length of the substring (LN) is equal to the length of the LCS of the substring (LN + k) to be searched. Then, the corresponding substrings complement each other, k indicates the number of characters deleted, and the question is 2.
In this case, the complexity is irrelevant to K. However, this method has never been AC, and you need to correct it if it is correct or not.