iota-0.1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.ByteString.Manacher

Synopsis

Documentation

manacher :: ByteString -> Vector Int Source #

n must be odd

O(n)

>>> import qualified Data.ByteString.Char8 as C
>>> manacher (C.pack "a")
[1]
>>> manacher (C.pack "aba")
[1,2,1]
>>> manacher (C.pack "a$b$b$a")
[1,1,2,4,2,1,1]