Skip to content

Instantly share code, notes, and snippets.

@igorvanloo
Created July 23, 2021 05:46
Show Gist options
  • Save igorvanloo/28305c7f397527e88c4b0f3e900c1f6e to your computer and use it in GitHub Desktop.
Save igorvanloo/28305c7f397527e88c4b0f3e900c1f6e to your computer and use it in GitHub Desktop.
Problem 33
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