def length_of_longest_palindromic_substring(s):
return max(string.palindrome_radiuses(f"#{'#'.join(S)}#"))
def length_of_longest_palindromic_substring(s):
return max(max(palindrome_radiuses(S, is_for_odd_len=True)) * 2 + 1,
max(palindrome_radiuses(S, is_for_odd_len=False)) * 2)
radiuses = palindrome_radiuses(f"#{'#'.join(S)}#")
def is_palindrome(beg, end, radiuses):
center = beg + end
return end - beg - 1 <= radiuses[center]