Useful links for understanding.
Understand how kmp works, Post by Ruanyi Feng
Understand how to calculate the next table, post from Zhihu
My implementation of calculate next table.
1 | vector<int> cal_next(string s) { |
Useful links for understanding.
Understand how kmp works, Post by Ruanyi Feng
Understand how to calculate the next table, post from Zhihu
My implementation of calculate next table.
1 | vector<int> cal_next(string s) { |