We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int main(){
scanf(" %s",s);
int j,i=0;
long long ans=0;
for(j=0;j<100005;j++){
arr[j][0]=arr[j][1]=arr[j][2]=-1;}
while(s[i]!='\0'){
if((int)s[i]=='0'){
ans=ans+1;
}
else {
ans=ans+fun(i,0);
}
i++;}
printf("%lld",ans);
return 0;}
//can anyone please help out.
//my above code is giving time out for test cases above 12
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Super Six Substrings
You are viewing a single comment's thread. Return to all comments →
include
include
char s[100005]; int arr[100005][3];
int fun(int x,int m){
}
int main(){ scanf(" %s",s); int j,i=0; long long ans=0; for(j=0;j<100005;j++){ arr[j][0]=arr[j][1]=arr[j][2]=-1;} while(s[i]!='\0'){ if((int)s[i]=='0'){