🌱 Knuth–Morris–Pratt Algorithm
You make an index to tell you how far you can shift when you find a mismatch. Saves looking up things that are guaranteed not to match.
Knuth–Morris–Pratt algorithm for string search https://gbhat.com/algorithms/kmp.html https://www.youtube.com/watch?v=pu2aO_3R118