Skip to content

Instantly share code, notes, and snippets.

@okplanbo
Created July 23, 2018 10:20
Show Gist options
  • Save okplanbo/a0a78344bc81bc8d9c5beb5dda501858 to your computer and use it in GitHub Desktop.
Save okplanbo/a0a78344bc81bc8d9c5beb5dda501858 to your computer and use it in GitHub Desktop.
Find common characters in two strings
#Given two strings find characters present in both. E.g, for "harpoon" and "countryside", the answer is "nro".
#https://www.talentrider.com
def intersection(a, b):
return ''.join(set(a) & set(b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment