# Advent of Code day 6

[Today's puzzle](https://adventofcode.com/2020/day/6) involves parsing groups of passenger forms (each passenger form is made up of one or more letters).  

For the first part we go through and keep track of how many unique letters there are in each group of forms ('unique' -- so we probably want to use a set).  Since each group includes spaces and new lines, which I don't want, I use the python command ‘isalpha()’ to add only the letters to a list. Then I get all the unique characters by turning the list into a set and returning the length of that set.  I add the results together for all the groups and I have my first star.  

Part two.  We now need to count how many characters appear in **every** passenger form of a group -- and then add up the group totals. I set up a second routine that first finds a set of all the unique characters present in each group of passports (i.e. the same logic as part 1) and then goes through the individual forms and checks for each character.  If a character is not present in a form, I remove it from the group set. That leaves us with only the characters that are present in every form of the group.  This works on the test data set, but not on my actual input.  So it’s time to dive into the actual values.  

I tend to debug using print statements, so I have the code print out each form and the status of “items” (what I use to keep track of the unique characters in each set of customs forms) at each step.  I find this at the end:

```
Form, items: lpjafmzv {'m', 'p', 'j'}
Form, items:  {'m', 'p', 'j'}
final set of items: set()
``` 

What’s happening here is that the last form contains nothing -- it’s just the last new line in my input file!  I could code my way out of this, but I take the easier route and just open the file and remove the final new line.  

Success! Two stars!
