Longest pallindromic substring

I am not able to understand the logic in this question
so can you please explain me??

hello @guptakeshav885

the logic for this problem is simple .
a) find all odd length palindrome
go to each character and assume it as centre of the palindrome and expand in both directions if charcter at both position match.
and keep track largest palindrome

b) find all even length plaindrome
here u need to expand only if u find two same consecutive chacters.