Last active
December 6, 2020 18:07
-
-
Save fxn/ae935daeb7554b4caccba3970f1d2a0d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import strutils, sequtils, sets | |
| var sum = 0 | |
| for group in readAll(stdin).strip.split("\n\n"): | |
| var answers: seq[HashSet[char]] | |
| for person in group.split("\n"): | |
| answers.add(person.toHashSet()) | |
| sum += answers.foldl(a * b).card | |
| echo sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment