This theory is part of Premium
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricingCount every palindromic substring in one linear pass.
What this asks
Count every palindromic substring.
Center expansion counts each palindrome as it is found; Manacher does the same in one linear pass with mirror reuse.
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricing