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.







