Skip to content

Instantly share code, notes, and snippets.

@redspider
Created December 6, 2020 10:34
Show Gist options
  • Save redspider/afda33ba17a492f76c0ffe49965c99e5 to your computer and use it in GitHub Desktop.
Save redspider/afda33ba17a492f76c0ffe49965c99e5 to your computer and use it in GitHub Desktop.
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