Created
December 6, 2020 10:34
-
-
Save redspider/afda33ba17a492f76c0ffe49965c99e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce | |
print("Part 1") | |
print(sum([len(set(list(bunch.replace("\n", "")))) for bunch in INPUT.split("\n\n")])) | |
print("Part 2") | |
print(sum(len(reduce(set.intersection, [set(line) for line in bunch.split("\n")])) for bunch in INPUT.split("\n\n"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment