Skip to content

Commit 98851f3

Browse files
committed
Fix Rabin-Karp Algorithm
1 parent aedc710 commit 98851f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

String/Rabin-Karp Algorithm/code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ for (let i = 0; i <= N - M; i++) {
3434
*/
3535
if (hashPattern === hashText) {
3636
let f = 0;
37-
tracer1.select(i, i + M).delay();
37+
tracer1.select(i, i + M - 1).delay();
3838
tracer2.select(0, M - 1).delay();
3939
for (let j = 0; j < M; j++) {
4040
tracer1.patch(i + j).delay();

0 commit comments

Comments
 (0)