The four families overlap - a deletion and a replacement can land on the same string. Today you union them into one deduplicated set of every distinct string exactly one edit from a word.
Combine the four edit families into a single set with duplicates removed.
Run all four generators on a word and you get every string one edit away - but with
duplicates. Inserting a before the a in "a" and inserting it after both
produce aa; a substitution and an insertion can coincide on longer words. Since
what you actually want is the set of candidates, you union the four lists into a
set, which collapses those repeats automatically.
The counts make the overlap concrete. For the single letter a: one deletion (the
empty string), no transpositions, 25 substitutions, and 52 insertions that dedupe
to 51 (because aa appears twice) - 1 + 25 + 51 = 77 distinct strings. The
original word is never among them, because every family produces a genuine edit.
This set, edits1, is the raw material; the next lesson keeps only the members that
are real words.
func edits1(word string) map[string]bool {// union deletes + transposes + replaces + inserts into a set// the set collapses the duplicates the four families produce}