I failed to create something new, but I'll share my thought process, and how it almost led me to reinventing a well-known solution.
Table of contents
- Prelude.
- The naive implementation.
- The thought process.
- The algorithm.
- The Karp, and the Rabin.
- Closing thoughts.
- Homework.
- Extras:
Prelude
needle = 'needle'
haystack = 'do I have a needle? Yes I do'
assert(needle in haystack)