'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function manacher(text) { const N = text.length; const _size = (N << 1) - 1; const radius = new Array(_size).fill(0); radius[0] = 1; for (let i = 1, j = 0; i < _size; ++i) { const p = i >> 1; const q = i - p; const r = ((j + 1) >> 1) + radius[j] - 1; let L = r < q ? 0 : Math.min(r - q + 1, radius[(j << 1) - i]); while (p > L - 1 && q + L < N && text[p - L] === text[q + L]) L += 1; radius[i] = L; if (q + L - 1 > r) j = i; } return radius; } exports.default = manacher; exports.manacher = manacher;