Created
July 23, 2021 05:46
-
-
Save igorvanloo/28305c7f397527e88c4b0f3e900c1f6e to your computer and use it in GitHub Desktop.
Problem 33
This file contains hidden or 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
def compute(): | |
values = [] | |
numer = 1 | |
denom = 1 | |
for x in range(10,100): | |
for y in range(x+1, 100): | |
if x%10 != 0 and y%10 != 0: | |
value1 = str(x) | |
value2 = str(y) | |
for a in value1: | |
for b in value2: | |
if a == b: | |
x1 = int(value1.replace(a,"",1)) | |
y1 = int(value2.replace(b,"",1)) | |
if x/y == x1/y1: | |
numer *= x1 | |
denom *= y1 | |
values.append([x,y]) | |
print(values) | |
return denom/math.gcd(denom,numer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment