add kmp and validPalindrome