Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
recursion solution in Clear category for Mathematically Lucky Tickets by David_Jones
from itertools import product
def possible_results(data):
yield int(data)
for i in range(1, len(data)):
for (x,y) in product(
possible_results(data[:i]), possible_results(data[i:])
):
yield from (x+y, x-y, x*y)
if y:
yield x/y
def checkio(data):
return all(result != 100 for result in possible_results(data))
July 1, 2019