My issue
What is problem in this code
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
int n,q;
cin>>n>>q;
string str;
cin>>str;
for(int i=0;i<=q;i++)
{
string check;
check[0]=str[0];
int count=1,max=0;
int j=1;
int N=n;
while(N--)
{
if(str[j]==check[0])
{
count++;
}
else
{
if(max<count)
{
max=count;
}
check=str[j];
count=1;
}
j++;
}
cout<<max;
string str2;
cin>>str2;
str.append(str2);
n++;
}
cout<<endl;
}
return 0;
}
Problem Link: Another Good String Practice Coding Problem - CodeChef