Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
combination solution in Clear category for Break Rings by Sim0000
from itertools import combinations
def break_rings(rings):
uniq_rings = set.union(*rings)
for n in range(1, len(uniq_rings)):
for destroy in combinations(uniq_rings, n): # we break n rings
if all(ring & set(destroy) for ring in rings): return n # found
Feb. 4, 2015
Comments: