Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Rectangles Union by kazuki.h
from itertools import product
def rectangles_union(recs):
one_square_set = set()
for x1, y1, x2, y2 in recs: one_square_set = one_square_set | {(x, y) for x, y in product(range(x1, x2), range(y1, y2))}
return len(one_square_set)
Dec. 14, 2021
Comments: