Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Fraction, recursive generator solution in Clear category for Mathematically Lucky Tickets by juestr
from fractions import Fraction
def checkio(data):
def results(data):
yield Fraction(data)
for i in range(1, len(data)):
for x in results(data[:i]):
xval = Fraction(x)
for y in results(data[i:]):
if (yval:=Fraction(y)):
yield xval + yval
yield xval - yval
yield xval * yval
yield xval / yval
else:
yield 0
yield xval
return all(r != 100 for r in results(data))
Aug. 9, 2021
Comments: