- Diffuse from a starting point to both ends
- Palindrome substring can be either even or odd length
- Max length should be
k-j+1, but whenj,kexitwhile,j--,k++would extend one step on both ends:k-j-1would be the right length because of+2difference. substring(start, end)would be a start ofj+1to justify the-1
1 | class Solution { |