m trying a lot and am able to pass all self generated test cases…yet i get wa each and every time…i am done with the programming .i just need a little help on sub tasks…

What you can do is to generate some random string of length 20 let say, invoke your algorithm for each L and R possible and check, whether this is the same as the brute force solution results - I believe if you do that, you’ll find the problem…

That idea did caught a bug in the solution

used big integer and resolved the problem…now i am getting tle with 2.01 sec…removing biginteger haunts me with a WA…any further help ??

sub string 00 will give 3 as answer ??

[1,1]=0=+1

[2,2]=0=+1

[1,2]=00=+1

total 3

There is no need of bigint afaik

1 Like

Yes (and some mess, because too short)…