1
0
Fork 0
adventofcode/2018/2/part1.py

13 lines
280 B
Python
Executable File

#!/usr/bin/env python3
import fileinput
from collections import Counter
def main():
n2, n3 = map(sum, zip(*map(lambda c: (2 in c.values(), 3 in c.values()), map(Counter, map(str.strip, fileinput.input())))))
return n2 * n3
if __name__ == '__main__':
print(main())