Skip to content

Instantly share code, notes, and snippets.

@ricardocchaves
Created October 4, 2022 09:49
Show Gist options
  • Save ricardocchaves/a5619e1199ea798fc9b3003c1d157a8d to your computer and use it in GitHub Desktop.
Save ricardocchaves/a5619e1199ea798fc9b3003c1d157a8d to your computer and use it in GitHub Desktop.
#!/bin/python3
# https://www.reddit.com/r/london/comments/xup3yh/monday_maths_at_canada_water_tube_station/
def allUnique(x):
seen = set()
return not any(i in seen or seen.add(i) for i in str(x))
def allEqual(x):
return len(set(str(x))) == 1
ABCDE = 9999
A = 1
EEEEE = 0
while ABCDE < 100000:
ABCDE += 1
if not allUnique(ABCDE):
continue
A = ABCDE//10000
EEEEE = ABCDE * A
if allEqual(EEEEE):
print("ABCDE:{}\nA:{}\nEEEEE:{}".format(ABCDE,A,EEEEE))
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment