Fixup day18 and add second part
[advent-of-code-2020.git] / day06 / summary.txt
1 --- Day 6: Custom Customs ---
2 As your flight approaches the regional airport where you'll switch to a much larger plane, customs declaration forms are distributed to the passengers.
3
4 The form asks a series of 26 yes-or-no questions marked a through z. All you need to do is identify the questions for which anyone in your group answers "yes". Since your group is just you, this doesn't take very long.
5
6 However, the person sitting next to you seems to be experiencing a language barrier and asks if you can help. For each of the people in their group, you write down the questions for which they answer "yes", one per line. For example:
7
8 abcx
9 abcy
10 abcz
11 In this group, there are 6 questions to which anyone answered "yes": a, b, c, x, y, and z. (Duplicate answers to the same question don't count extra; each question counts at most once.)
12
13 Another group asks for your help, then another, and eventually you've collected answers from every group on the plane (your puzzle input). Each group's answers are separated by a blank line, and within each group, each person's answers are on a single line. For example:
14
15 abc
16
17 a
18 b
19 c
20
21 ab
22 ac
23
24 a
25 a
26 a
27 a
28
29 b
30 This list represents answers from five groups:
31
32 The first group contains one person who answered "yes" to 3 questions: a, b, and c.
33 The second group contains three people; combined, they answered "yes" to 3 questions: a, b, and c.
34 The third group contains two people; combined, they answered "yes" to 3 questions: a, b, and c.
35 The fourth group contains four people; combined, they answered "yes" to only 1 question, a.
36 The last group contains one person who answered "yes" to only 1 question, b.
37 In this example, the sum of these counts is 3 + 3 + 3 + 1 + 1 = 11.
38
39 For each group, count the number of questions to which anyone answered "yes". What is the sum of those counts?
40
41 Your puzzle answer was 6534.
42
43 --- Part Two ---
44 As you finish the last group's customs declaration, you notice that you misread one word in the instructions:
45
46 You don't need to identify the questions to which anyone answered "yes"; you need to identify the questions to which everyone answered "yes"!
47
48 Using the same example as above:
49
50 abc
51
52 a
53 b
54 c
55
56 ab
57 ac
58
59 a
60 a
61 a
62 a
63
64 b
65 This list represents answers from five groups:
66
67 In the first group, everyone (all 1 person) answered "yes" to 3 questions: a, b, and c.
68 In the second group, there is no question to which everyone answered "yes".
69 In the third group, everyone answered yes to only 1 question, a. Since some people did not answer "yes" to b or c, they don't count.
70 In the fourth group, everyone answered yes to only 1 question, a.
71 In the fifth group, everyone (all 1 person) answered "yes" to 1 question, b.
72 In this example, the sum of these counts is 3 + 0 + 1 + 1 + 1 = 6.
73
74 For each group, count the number of questions to which everyone answered "yes". What is the sum of those counts?
75
76 Your puzzle answer was 3402.
77
78 Both parts of this puzzle are complete! They provide two gold stars: **
79
80 At this point, you should return to your Advent calendar and try another puzzle.
81
82 If you still want to see it, you can get your puzzle input.
83
84 You can also [Share] this puzzle.