Created
February 27, 2020 18:50
-
-
Save gamorales/faa78aa848798ad9e001380e987cace8 to your computer and use it in GitHub Desktop.
Find if a word is an anagram of other.
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
import re | |
def anagram(a, b): | |
regex = f"^(?!.*(.).*\1)[{a}]*$" | |
if re.search(regex, b, flags=re.IGNORECASE): | |
return True | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment