Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Brute force solution in Clear category for Break Rings by nickie
from itertools import chain, combinations
def break_rings(rings):
N = max(map(max, rings))
R = range(1, N+1)
for S in chain.from_iterable(combinations(R, r) for r in range(N+1)):
if not any(map(set(S).isdisjoint, rings)):
return len(S)
Feb. 3, 2015
Comments: