This is the ques…
And this is my soln…I dont know what is wrong…
This is the ques…
And this is my soln…I dont know what is wrong…
your solution link is wrong.
Copy your code here. Your code link is wrong that is a link of code editor not of your solution.
#include
#include <bits/stdc++.h>
using namespace std;
int main() {
int t,m,n,x,y,i,j,c,b,l,arr2[10000];
char f,p,arr[10000];
cin>>t;
while(t–)
{
cin>>n >> m;
cin>>x >> y;
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
cin>>arr[j];
f=arr[j];
p=arr[j];
if(arr[j]==‘F’)
c++;
else if(arr[j]==‘P’)
l++;
else
b++;
if(c>=x)
arr2[j]=1;
else if(c==y && l==y)
arr2[j]=1;
else
arr2[j]=0;
}
}
for(i=0;i<m;i++)
{
cout<<arr2[i];
}
}
return 0;
}
done
In second else if it should be x-1 ==c && l>=y
Make this change it might run successfully now I guess
Yes thanks, let me edit that