Simple Rolling Hash question , Mission Helix 31 OCT 2020 , Palindromic Query

Question : “

My solution : “

I don’t know why it gives me TLE for some of TC’s, no editorials too , so I m unable to find a more optimized solution, can anyone please help

@carre @aryan12 @everule1 @ajeeb @aryanc403 @l_returns

1 Like

Use manachers algorithm here. String hashing is slow.

1 Like

Oh shit, how can I forget this, Thanks @everule1 bro :pray: