Skip to content

Instantly share code, notes, and snippets.

@skilldeliver
Created December 6, 2020 12:52
Show Gist options
  • Save skilldeliver/c9a952f94bde22e5acac701661df1b65 to your computer and use it in GitHub Desktop.
Save skilldeliver/c9a952f94bde22e5acac701661df1b65 to your computer and use it in GitHub Desktop.
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