Problem Statement :
Given a string, find out if the string is K-Palindrome or not.
A K-palindrome string transforms into a palindrome on removing at most k characters from it.
The input contains two lines.
The first line has string S.
The second line has the value ‘k’.
The output contains one line either “YES” or “NO” depending on whether the given string ‘S’ is a K palindrome or not.
Explanation of given Test Cases :
Here we notice that if we remove 'b' and 'd' from the given string, the remaining string is a palindrome.
The idea is to find the longest palindromic subsequence of the given string. If the difference between the longest palindromic subsequence and the original string is less than equal to k, then the string is k-palindrome else it is not k-palindrome.