Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Break Rings by tihenko
# migrated from python 2.7
from itertools import *
from functools import reduce
def break_rings(rings):
total_rings = max(reduce(lambda x,y: list(x)+list(y),rings ))
for answer in range(1, total_rings):
for comb in (combinations(list(range(1, total_rings+1)), answer)):
if max([len(connection-set(comb)) for connection in rings]) == 1:
return answer
Sept. 9, 2015