AdventOfCode-2020/day6.cr

14 lines
211 B
Crystal
Raw Normal View History

2020-12-05 21:15:22 -08:00
require "advent"
INPUT = input(2020, 6).split("\n\n")
def part1
2020-12-07 23:38:26 -08:00
INPUT.sum &.chars.uniq!.count(&.ascii_letter?)
2020-12-05 21:15:22 -08:00
end
def part2
2020-12-07 23:38:26 -08:00
INPUT.sum &.lines.map(&.chars.to_set).intersect.size
2020-12-05 21:15:22 -08:00
end
2020-12-07 23:38:26 -08:00
puts part1
puts part2