From 9b376a5bfb17fb2244a24d6041fc24fc5d4bd422 Mon Sep 17 00:00:00 2001 From: Nolan Emirot Date: Sun, 29 Mar 2020 01:19:19 -0700 Subject: [PATCH] Typo in comment rabin_karp.py (#1820) * Update rabin_karp.py fix: typo * Update rabin_karp.py Co-authored-by: Christian Clauss --- strings/rabin_karp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/rabin_karp.py b/strings/rabin_karp.py index 1fb145ec9..22da0de80 100644 --- a/strings/rabin_karp.py +++ b/strings/rabin_karp.py @@ -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])