Typo in comment rabin_karp.py (#1820)

* Update rabin_karp.py

fix: typo

* Update rabin_karp.py

Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
Nolan Emirot 2020-03-29 01:19:19 -07:00 committed by GitHub
parent f17e9822b0
commit 9b376a5bfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,7 @@ def rabin_karp(pattern, text):
return True
if i == t_len - p_len:
continue
# Calculating the ruling hash
# Calculate the https://en.wikipedia.org/wiki/Rolling_hash
text_hash = (
(text_hash - ord(text[i]) * modulus_power) * alphabet_size
+ ord(text[i + p_len])