Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First (long) solution in Clear category for Rectangles Union by ssk8
from typing import List, Tuple
def rectangles_union(recs: List[Tuple[int]]) -> int:
area = []
for x1, y1, x2, y2 in recs:
for x in range(x1, x2):
for y in range(y1, y2):
if (x, y) not in area:
area.append((x, y))
return len(area)
Nov. 29, 2018
Comments: