Optimal Algorithmic Approach
Expand-around-center: 2n-1 possible centers, O(n) each in worst case.
Core Invariants & Edge Cases
- Expand-around-center: for each index expand both odd and even centers
- Track best start and length seen
- DP is O(n²) time & space; expansion is O(n²) time O(1) space