Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Mathematically Lucky Tickets by tamacjp
def divide(data):
# as integer (allow over 10)
yield int(data)
# divide 123456: 1 23456, 12 3456, 123 456, ...
for pos in range(1, len(data)):
for left in divide(data[:pos]):
for right in divide(data[pos:]):
# calculate + - * /
yield left + right
yield left - right
yield left * right
if right:
yield left / right
def checkio(data):
# enumerate all pattern
for x in divide(data):
if x == 100:
return False
return True
March 8, 2014
Comments: