Skip to content

Instantly share code, notes, and snippets.

@hallfox
Created March 22, 2016 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hallfox/29081ea9cd2eba2d8635 to your computer and use it in GitHub Desktop.
Save hallfox/29081ea9cd2eba2d8635 to your computer and use it in GitHub Desktop.
s, t, xs, start = input(), input(), 26*[0], ord('a')
for x,y in zip(s,t):
xs[ord(x)-start] += 1
xs[ord(y)-start] -= 1
print("anagram") if len(s) == len(t) and xs == 26*[0] else print("no")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment