part1 (1951B)
1--- Day 6: Custom Customs --- 2 3As your flight approaches the regional airport where you'll switch to a much larger plane, customs 4declaration forms are distributed to the passengers. 5 6The form asks a series of 26 yes-or-no questions marked a through z. All you need to do is identify 7the questions for which [1m[37manyone in your group[0m answers "yes". Since your group is just 8you, this doesn't take very long. 9 10However, the person sitting next to you seems to be experiencing a language barrier and asks if you 11can help. For each of the people in their group, you write down the questions for which they answer 12"yes", one per line. For example: 13 14abcx abcy abcz 15 16In this group, there are [1m[37m6[0m questions to which anyone answered "yes": a, b, c, x, y, and 17z. (Duplicate answers to the same question don't count extra; each question counts at most once.) 18 19Another group asks for your help, then another, and eventually you've collected answers from every 20group on the plane (your puzzle input). Each group's answers are separated by a blank line, and 21within each group, each person's answers are on a single line. For example: 22 23abc 24 25a b c 26 27ab ac 28 29a a a a 30 31b 32 33This list represents answers from five groups: 34 35- The first group contains one person who answered "yes" to [1m[37m3[0m questions: a, b, and c. - 36The second group contains three people; combined, they answered "yes" to [1m[37m3[0m questions: 37a, b, and c. - The third group contains two people; combined, they answered "yes" to [1m[37m3[0m 38questions: a, b, and c. - The fourth group contains four people; combined, they answered "yes" to 39only [1m[37m1[0m question, a. - The last group contains one person who answered "yes" to only 40[1m[37m1[0m question, b. 41 42In this example, the sum of these counts is 3 + 3 + 3 + 1 + 1 = [1m[37m11[0m. 43 44For each group, count the number of questions to which anyone answered "yes". [1m[37mWhat is the 45sum of those counts?[0m 46 47