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

Sign in to watch this lesson
Algorithms - Strings · 5:17
A polynomial rolling hash turns any string into one number, and prefix hashes let us compare two windows of any length with a single integer test. We build the hash of abc and the prefix hashes of abcab, align windows by a power of p instead of a modular inverse, pick the base and modulus, measure the birthday bound (476 colliding pairs among a million strings with one hash, none with two), and watch a Thue-Morse string break every 64-bit overflow hash.