Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
frozen DP solution in Speedy category for Break Rings by gyahun_dash
def break_rings(rings):
wreck = lambda ring: {frozenset({part}) for part in ring}
broken = wreck(rings[0])
for ring in rings[1:]:
broken = {p | b for p in wreck(ring) for b in broken}
return min(map(len, broken))
May 30, 2015