Naive substring search
Find every position where a short word occurs in a longer text. Try finding “ana” in “banana”.
Place the pattern under the text and compare letters from left to right. Stop at the first mismatch.
Move the pattern one place, even after a match. Two occurrences can overlap.
For n text letters and m pattern letters, one alignment takes at most m comparisons. An empty pattern matches at every boundary, including both ends.