Skip to content

Commit 4d6e154

Browse files
committed
Removed comments from code
1 parent cb57da0 commit 4d6e154

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

algorithms/searching/kmp_search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ def search(string, word):
2929
return offsets
3030

3131
prefix = compute_prefix(word)
32-
q = 0 # q is the number of characters matched
32+
q = 0
3333
for index, letter in enumerate(string):
3434
while q > 0 and word[q] != letter:
35-
q = prefix[q - 1] # next character does not match
35+
q = prefix[q - 1]
3636
if word[q] == letter:
3737
q += 1
3838
if q == word_length:
3939
offsets.append(index - word_length + 1)
40-
q = prefix[q - 1] # look for next match
40+
q = prefix[q - 1]
4141
return offsets
4242

4343

0 commit comments

Comments
 (0)