⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 18m 44s17 days 22 hours 18 minutes 44 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 18m 44s17 days 22 hours 18 minutes 44 seconds.

Sign in to watch this lesson
Algorithms - Strings · 4:38
Rabin-Karp finds a pattern by sliding a window along the text and comparing one number per position: the window's prefix-hash difference against the pattern's hash times p^i, for O(|s| + |t|) in total. We watch a fake hit appear with a toy modulus and get caught by checking the letters, then use binary search on the length, with one hashing sweep per probe, to find the longest repeated substring.