What am i doing wrong? Edit: Issue resolved

i was solving this problem and i did this

#include
using namespace std;

int main(){
int t;
cin>>t;
while(t–){
int N,K;
cin>>N>>K;
int A[K];
for(int i=0;i<K;i++){
cin>>A[i];
}
while(N–){
int sum=0;
string S;
cin>>S;
for(int i=0;i<K;i++){
if(S[i]==‘1’)
sum=sum+A[i];
}
cout<<sum<<endl;
}

}

return 0;
}
can some one please let me what am i doing wrong?

Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

1 Like

You just solved it. Hope your issue is resolved.

i uderstand what i did wrong but still thankyou so much for answering