Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second (short) solution in Clear category for Rectangles Union by ssk8
from typing import List, Tuple
def rectangles_union(recs: List[Tuple[int]]) -> int:
return len({(x, y) for a, c, b, d in recs for x in range(a, b)for y in range(c, d)})
Nov. 29, 2018
Comments: