File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/algorithms/patternFinding Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 17
17
* there is no prefix ending before its index, 0, that can be matched with.
18
18
* Read: ^ ^ 'B' and 'C' cannot be matched with any prefix which are just 'A' and 'AB' respectively.
19
19
* Read: ^ Can be matched with an earlier 'A'. So we store 1.
20
- * Prefix is the substring from idx 0 to 1 (exclusive).
21
- * Which can also be interpreted as the index of the next character to match against!
20
+ * Prefix is the substring from idx 0 to 1 (exclusive). Note consider prefix from 0-indexed.
21
+ * Realise 1 can also be interpreted as the index of the next character to match against!
22
22
* Read: ^ ^ Similarly, continue matching
23
23
* Read: ^ ^ No matches, so 0
24
24
* Read: ^ ^ ^ ^ ^ ^ Match with prefix until position 6!
You can’t perform that action at this time.
0 commit comments