human
Find if string is K | Find if given string is K - Palindrome or not.
Create a table to store results of subproblems.
Fill dp [ ] [ ] in bottom up manner.
If first string is empty , only option is to remove all characters of second string.
If second string is empty , only option is to remove all characters of first string.
If last characters are same , ignore last character and recur for remaining string.
If last character are different , remove it and find minimum.
dp [ i ] [ j ] = 1 + min ( dp [ i - 1 ] [ j ] , Remove from str1 ( dp [ i ] [ j - 1 ] ) ) Remove from str2.
Returns true if str is k palindrome ..
Driver program"
Solution in Python:
assistant
#Here is code to find if string is K and the other steps required.
 def isKPalDP ( str1 , str2 , m , n ) :
	dp = [ [ 0 ] * ( n + 1 ) for _ in range ( m + 1 ) ]
	for i in range ( m + 1 ) :
		for j in range ( n + 1 ) :
			if not i :
			elif not j :
			elif ( str1 [ i - 1 ] == str2 [ j - 1 ] ) :
				dp [ i ] [ j ] = dp [ i - 1 ] [ j - 1 ]
			else :
	return dp [ m ] [ n ]
def isKPal ( string , k ) :
	revStr = string [ : : - 1 ]
	l = len ( string )
	return ( isKPalDP ( string , revStr , l , l ) <= k * 2 )
string = " acdcb "
k = 2
print ( " Yes " if isKPal ( string , k ) else " No " )