Longest palindrome linear time

Write codeHard36 minAmazon and Microsoft style

Your task

Given a string s, return the LENGTH of the longest palindromic substring (contiguous). Solve it in O(n) time. 1 <= len(s) <= 100000, lowercase letters. Example: 'forabccddccbafor' -> 10 ('abccddccba').

Examples

longest_palindrome_len(s: str) -> int
Example 1
Inputlongest_palindrome_len("forabccddccbafor")
Output10