Skip to content

Commit 45101b5

Browse files
✨ feat(data): Even more inputs.
Inspired by the example at https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm.
1 parent 2110b8f commit 45101b5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/data.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,40 @@ const data = [
141141
},
142142
],
143143
},
144+
{
145+
string: 'ABC ABCDAB ABCDABCDABDE',
146+
patterns: [
147+
{
148+
pattern: 'ABCDABD',
149+
hits: [15],
150+
},
151+
],
152+
},
153+
{
154+
string: 'ABCABCDABABCDABCDABDE',
155+
patterns: [
156+
{
157+
pattern: 'ABCDABD',
158+
hits: [13],
159+
},
160+
{
161+
pattern: 'ABCDAB',
162+
hits: [3, 9, 13],
163+
},
164+
{
165+
pattern: 'ABCABC',
166+
hits: [0],
167+
},
168+
{
169+
pattern: 'ABC',
170+
hits: [0, 3, 9, 13],
171+
},
172+
{
173+
pattern: 'ABD',
174+
hits: [17],
175+
},
176+
],
177+
},
144178
];
145179

146180
export default data;

0 commit comments

Comments
 (0)