목차

가장 긴 팰린드롬

ps
링크programmers.co.kr/…
출처프로그래머스
문제 번호12904
문제명가장 긴 팰린드롬
레벨Level 3
분류

Manacher

시간복잡도O(n)
인풋사이즈n<=2500
사용한 언어Python
해결날짜2021/07/04

풀이

코드

"""Solution code for "Programmers 12904. 가장 긴 팰린드롬".

- Problem link: https://programmers.co.kr/learn/courses/30/lessons/12904
- Solution link: http://www.teferi.net/ps/problems/programmers/12904
"""

from teflib import string


def solution(s):
    return max(string.palindrome_radiuses('#' + '#'.join(s) + '#'))