Earlier quoted context omitted.
What if you used a map and stored the value as a key? Then get all keys? Could work as a simple alternative and you could check if values are in it. Requires thinking if you want to implement set difference or intersection. I just figured depending on needs using existing built-in types may be fun.
Intersections are the reason you'd want a set, as the original post indicates. See the problem here: https://adventofcode.com/2022/day/3 (sets are even more of a fit for part 2, which is hidden for an anonymous viewer).
for key, _ := range first {
if _, found2 := second[key]; found2 {
if _, found3 := third[key]; found3 {
// This is the intersection of 3 sets
}
}
}