Skip to content

Commit a47643d

Browse files
Merge pull request youngyangyang04#994 from Leovoki/patch-1
Update 0459.重复的子字符串.md
2 parents 26a6a8f + d28293d commit a47643d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

problems/0459.重复的子字符串.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
这里就要说一说next数组了,next 数组记录的就是最长相同前后缀( [字符串:KMP算法精讲](https://programmercarl.com/0028.实现strStr.html) 这里介绍了什么是前缀,什么是后缀,什么又是最长相同前后缀), 如果 next[len - 1] != -1,则说明字符串有最长相同的前后缀(就是字符串里的前缀子串和后缀子串相同的最长长度)。
4747

48-
最长相等前后缀的长度为:next[len - 1] + 1。
48+
最长相等前后缀的长度为:next[len - 1] + 1。(这里的next数组是以统一减一的方式计算的,因此需要+1)
4949

5050
数组长度为:len。
5151

0 commit comments

Comments
 (0)