Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int t;
- cin>>t;
- while(t--) {
- string s;
- int n,k;
- int count=0;
- cin>>n>>k;
- cin>>s;
- for(int i=0;i<(n/2);i++) {
- if(s[i]!=s[n-i-1]) {
- s[i]=s[n-i-1];
- count++;
- }
- }
- if(count=k) {
- cout<<"Yes"<<endl;
- }
- else {
- cout<<"No"<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment