2020/06.py
def part2():
    """
    This part is just a sum of the number of letters in the *intersection* of all of the
    responses for each group.
    """
    return sum(len(set.intersection(*g)) for g in groups)

    # The following was what I implemented when I solved night-of. The nice thing about
    # this method is that it was very easy to think about and I didn't take too much
    # work to bang out.
    s = 0
    for g in groups:
        for c in "abcdefghijklmnopqrstuvwxyz":
            no = False
            for p in g:
                if c not in p:
                    no = True
                    break

            if not no:
                s += 1

    return s

    This part is just a sum of the number of letters in the *intersection* of all of the
    responses for each group.
    
This part is just a sum of the number of letters in the *intersection* of all of the
responses for each group.
This part is just a sum of the number of letters in the * intersection * of all of the responses for each group .
def part2():
    return sum(len(set.intersection(*g)) for g in groups)
    s = 0
    for g in groups:
        for c in "abcdefghijklmnopqrstuvwxyz":
            no = False
            for p in g:
                if c not in p:
                    no = True
                    break
            if not no:
                s += 1
    return s
def part2 ( ) : return sum ( len ( set . intersection ( * g ) ) for g in groups ) s = 0 for g in groups : for c in "abcdefghijklmnopqrstuvwxyz" : no = False for p in g : if c not in p : no = True break if not no : s += 1 return s
This part is just a sum of the number of letters in the *intersection* of all of the
responses for each group.
This part is just a sum of the number of letters in the * intersection * of all of the responses for each group .
"""
    This part is just a sum of the number of letters in the *intersection* of all of the
    responses for each group.
    """ # The following was what I implemented when I solved night-of. The nice thing about # this method is that it was very easy to think about and I didn't take too much # work to bang out.