更新nxt[]数组时的代码如下:
while(t1<lens) { if(t2==-1||s2[t1]==s2[t2]) nxt[++t1]=++t2; else t2=nxt[t2]; }
为何t2=nxt[t2]是正确的(萌新毕竟是萌新,到处翻资料,看了一上午都没看懂)