Hi there. Can anyone share how to solve this problem? I think it can be solved using Manacher algo but i just can't figure out how to do this optimally. If anyone has solved this using manacher or any other way please do share your idea here. I have tried for a lot of time but failed.
Thanks in advance.








Kindly check out my comment at CSES-String Section Blog
Thanks i was able to solve it after looking at the comment.