Every Ctrl-F, grep, DNA search and spam filter is hunting for one short string inside a much longer one, and the trick that makes that hunt fast is never re-examining a character you already learned something about.
Before you start. You need to be comfortable with an index, a number naming one slot in a list, counting up from the start, and a loop that walks one array one step at a time. The words hash and trie return from Hashing and Trees (BST, balancing, heaps, tries). A one-line reminder rides along the first time each returns.
Lesson 22 of 96 in DSA
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.