You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/string/prefix-function.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,7 @@ We generate the string $s + \\# + t$, where $\\#$ is a separator that appear in
132
132
Let us calculate the prefix function for this string.
133
133
Now think about the meaning of the values of the prefix function, except for the first $n + 1$ entries (which belong to the string $s$ and the separator).
134
134
By definition the value $\pi[i]$ shows the longest length of a substring ending in position $i$ that coincides with the prefix.
135
-
But in our case this isisnothing more than the largest block that coincides with $s$ and ends at position $i$.
135
+
But in our case this is nothing more than the largest block that coincides with $s$ and ends at position $i$.
136
136
This length cannot be bigger than $n$ due to the separator.
137
137
But if equality $\pi[i] = n$ is achieved, then it means that the string $s$ appears completely in at this position, i.e. it ends at position $i$.
138
138
Just do not forget that the positions are indexed in the string $s +\\# + t$.