Skip to content

Commit 68349dd

Browse files
authored
Fix lcp calculation in suffix_array_short.hpp
1 parent 3ffb893 commit 68349dd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/strings/suffix_array/suffix_array_short.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ auto sa_short(const auto& s) {
3131
rep (k, 0, K) {
3232
if (f(sa[i + 1])[k] != f(sa[i])[k]) {
3333
lcp[i] = j * k + (sa[i] + j * k < n ? y[x[sa[i] + j * k]] : 0);
34+
break;
3435
}
3536
}
3637
} else {

0 commit comments

Comments
 (0)