3 ms·
Intersections are the reason you'd want a set, as the original post indicates. See the problem here: https://adventofcode.com/2022/day/3 https://adventofcode.co
by wging 4y ago
Intersections are the reason you'd want a set, as the original post indicates. See the problem here: https://adventofcode.com/2022/day/3 https://adventofcode.com/2022/day/3 (sets are even more of a fit for part 2, which is hidden for an anonymous viewer).
- Arainach 4y agoSure, but intersections are straightforward to write with Go maps: for key, _ := range first { if _, found2 := second[key]; found2 { if _, found3 := third[key]; found3 { // This is the intersection of 3 sets } } }
- deleted 4y ago[deleted]