my code passed the given sample test case but is showing the wrong answer on submission. can ayone help me?

:::::::::::code::::::::::::

#include

#include<bits/stdc++.h>

using namespace std;

int score(string str,int arr[],int k)

{

int sum=0;

for(int i=0;i<str.length();i++)

{

if(str[i]==‘0’)sum=sum+0;

else if(str[i]==‘1’)

{

sum=sum+arr[i];

}

}

return sum;

}

int main()

{

int t;

cin >> t;

```
while (t>0)
{
int n,k;
cin >> n>>k;
int a[k];
for(int i = 0; i < k; ++i)
{
cin >> a[i];
}
string s[n];
for(int i = 0; i < n; ++i)
{
cin >> s[i];
}
for(int i=0;i<n;i++)
cout << score(s[i],a,k) << endl;
t--;
}
return 0;
```

}