feat(solution): problem #33

main
steven 2023-08-02 12:04:14 -04:00
parent 7bc3e74202
commit 7683fafe8c
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
cancelledFractions = []
for i in range(10,100):
iStr = str(i)
for j in range(10,100):
jStr = str(j)
for k in range(1,10):
if str(k) in iStr and str(k) in jStr:
iStrK = iStr.replace(str(k),"",1)
jStrK = jStr.replace(str(k),"",1)
if len(iStrK) < 1:
iStrK = str(k)
if len(jStrK) < 1:
jStrK = str(k)
cancelledI = int(iStrK)
cancelledJ = int(jStrK)
print(cancelledI,cancelledJ)
if cancelledJ > 0 and cancelledI / cancelledJ == i/j and i/j < 1:
print(cancelledJ, " >0")
print(cancelledI, "/", cancelledJ, "==", i, "/", j)
print(i, "/", j, "<1")
cancelledFractions.append([[i,j],[cancelledI, cancelledJ]])
print(cancelledFractions)