Created
December 6, 2020 12:52
-
-
Save skilldeliver/c9a952f94bde22e5acac701661df1b65 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
def oneliner(data, part=1): | |
return sum([len(set(a for p in g.split() for a in p)) for g in data]) if part == 1 else sum([len(set(list([chr(97+i) for i in range(26)])).intersection(*[set(a for a in p) for p in g.split()])) for g in data]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment