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