Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.8k
Closed
Description
Article:Manacher's Algorithm - Finding all sub-palindromes in O(N)
Problem:
Below line ->
p[i] = max(0, min(r - i, p[l + (r - i)]));
in manacher_odd function, is max(0, ..) check really required?
As I tried some examples on paper, it seemed every time, the least value of p[i] = min(r - i, p[l + (r - i)]) is 0, so, can we write directly,
p[i] = min(r - i, p[l + (r - i)]);
Metadata
Metadata
Assignees
Labels
No labels