Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
set solution in Clear category for Rectangles Union by yoichi
from typing import List, Tuple
def rectangles_union(recs: List[Tuple[int]]) -> int:
u = set()
for rec in recs:
for x in range(rec[0], rec[2]):
for y in range(rec[1], rec[3]):
u.add((x,y))
return len(u)
Jan. 14, 2019
Comments: