here is the question https://www.hackerrank.com/challenges/weighted-uniform-string/problem?isFullScreen=true

```
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
long int i,j,n,flag=0,sum=0;
char str[10000001];
char ch;
long int arr[100000000];
long int arr1[100000000];
scanf("%s",str); //showing segmentation fault here in hackerrank ide but working on codechef ide
scanf("%ld",&n);
for(i=0;i<n;i++){
scanf("%ld",&arr1[i]);
}
for(i=0;i<strlen(str);i++){
ch=str[i];
if(i==0){
if(str[i]==str[i+1]){
sum=sum+(ch-96);
arr[i]=sum;
}else{
sum=sum+(ch-96);
arr[i]=sum;
sum=0;
}
continue;
}
if(str[i]==str[i+1]){
sum=sum+(ch-96);
arr[i]=sum;
}else{
sum=sum+(ch-96);
arr[i]=sum;
sum=0;
}
}
for(i=0;i<n;i++){
flag=0;
for(j=0;j<strlen(str);j++){
if(arr1[i]==arr[j]){
flag=1;
break;
}
}
(flag==1)?printf("YES\n"):printf("NO\n");
}
return 0;
}
```