Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Break Rings by Somebody12345678910
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)
July 17, 2021