diff --git a/2020/src/day6.nim b/2020/src/day6.nim index e94b935..2e698d6 100644 --- a/2020/src/day6.nim +++ b/2020/src/day6.nim @@ -4,4 +4,6 @@ proc part1*(s: Stream): int = s.readAll().split("\n\n").mapIt(it.split("\n").foldl(a.union(b.toHashSet), initHashSet[char]()).len).foldl(a + b) proc part2*(s: Stream): int = - s.readAll().split("\n\n").mapIt(it.split("\n").filterIt(it != "").foldl(a.intersection(b.toHashSet), "abcdefghijklmnopqrstuvwxyz".toHashSet()).len).foldl(a + b) + s.readAll().split("\n\n").mapIt( + it.split("\n").filterIt(it != "").foldl(a.intersection(b.toHashSet), "abcdefghijklmnopqrstuvwxyz".toHashSet()).len + ).foldl(a + b)