Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
set of coords solution in Clear category for Rectangles Union by l.szyman10
from typing import List, Tuple
def rectangles_union(recs: List[Tuple[int]]) -> int:
area = set()
for rec in recs:
new = {(i, j) for i in range(rec[0], rec[2]) for j in range(rec[1], rec[3])}
area |= new
return len(area)
Feb. 1, 2021
Comments: