Help me in solving SWAP_ problem

My issue

plz give me some hint to proceed with this question

My code

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int t,n,k;
	cin>>t;
  while(t--){
      cin>>n>>k;
      string s;
      cin>>s;
      
  }
	return 0;
}

Problem Link: SWAP_ Problem - CodeChef