Skip to content

Instantly share code, notes, and snippets.

@aasmpro
Created March 24, 2022 21:48
Show Gist options
  • Save aasmpro/54b8453f6ccb0723bcc0510c600ab601 to your computer and use it in GitHub Desktop.
Save aasmpro/54b8453f6ccb0723bcc0510c600ab601 to your computer and use it in GitHub Desktop.
Simple abba pattern check
check = list(input())
words = input().split(" ")
passed = True
data = {}
for c, w in zip(check, words):
d = data.get(c, None)
if d and d != w:
passed = False
break
else:
data[c] = w
print(passed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment