We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26fbe01 commit 76cfe8fCopy full SHA for 76cfe8f
strings/rabin_karp.py
@@ -168,7 +168,10 @@ def rabin_karp_multiple(
168
# Check if current hash matches any pattern hash
169
for pattern, pattern_hash in pattern_hashes.items():
170
# Verify to avoid spurious hits
171
- if text_hash == pattern_hash and text[i : i + pattern_length] == pattern:
+ if (
172
+ text_hash == pattern_hash
173
+ and text[i : i + pattern_length] == pattern
174
+ ):
175
results[pattern].append(i)
176
177
# Calculate hash for next window
0 commit comments