Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- manacher :: ByteString -> Vector Int
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]