aoc-2020-zig

Advent of Code 2020 Solutions in Zig
git clone https://git.sinitax.com/sinitax/aoc-2020-zig
Log | Files | Refs | README | sfeed.txt

part2 (1149B)


      1--- Part Two ---
      2
      3As you finish the last group's customs declaration, you notice that you misread one word in the
      4instructions:
      5
      6You don't need to identify the questions to which anyone answered "yes"; you need to
      7identify the questions to which everyone answered "yes"!
      8
      9Using the same example as above:
     10
     11abc
     12
     13a b c
     14
     15ab ac
     16
     17a a a a
     18
     19b
     20
     21This list represents answers from five groups:
     22
     23- In the first group, everyone (all 1 person) answered "yes" to 3 questions: a, b, and
     24c. - In the second group, there is no question to which everyone answered "yes". - In
     25the third group, everyone answered yes to only 1 question, a. Since some people did not
     26answer "yes" to b or c, they don't count. - In the fourth group, everyone answered yes to only
     271 question, a. - In the fifth group, everyone (all 1 person) answered "yes" to
     281 question, b.
     29
     30In this example, the sum of these counts is 3 + 0 + 1 + 1 + 1 = 6.
     31
     32For each group, count the number of questions to which everyone answered "yes".
     33What is the sum of those counts?
     34
     35