reimpl longest palindormicsubstring