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 first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains the integers N and K where N denotes the the length of the string.
The second line of each test case contains the string.
Print 1 if the given string is K-palindrome else print 0. Print the answer for each test case in a new line.
1<= T <=100
1<= N, K <=1000
Input : String - abcdecba, k = 1
Output : Yes
String can become palindrome by removing 1 character i.e. either d or e)
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.