problem: link text
my submission: link text
i tried all the possible cases on my local ide and it works fine but shows wrong answer in codechef. Can anybody help me out here?
problem: link text
my submission: link text
i tried all the possible cases on my local ide and it works fine but shows wrong answer in codechef. Can anybody help me out here?
Check your code fr sample input. You are doing a silly error. Ping me if you arent able to catch it.
Anyways, here they are-
Hey @prince90,
Here is a code snippet, which you can try or take help from.
test(t){
int a[30]={0};
for(int i=0;i<26;i++){
cin >> a[i];
}string str;
cin >> str;
int b[30]={0};
for(int i=0;i<str.length();i++){
b[str[i]-‘a’]=1;
}
int ans = 0;for(int i=0;i<26;i++){
if(b[i] == 0){ans+=(a[i]);
}
}cout << ans << "\n"; }
Hope this helps!
He further isnt resetting the frequency array as well.