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

Sign in to watch this lesson
Algorithms - Strings · 4:11
The simplest way to find a pattern in a text tries every start and compares letter by letter. We slide aab across aaaaaaaab and watch every alignment do the maximum work, derive the O(nm) worst case, measure a billion comparisons against near-linear random text on a Mac, show that std::string::find and the Horspool searcher have bad inputs too, expose hidden costs like substr in a loop, and pin down what brute force forgets at every mismatch.