Code Golf: Rectangle Intersection
Started: 1575763200, F jS, Y g:i:s A
Ends: 1576368000, F jS, Y g:i:s A
Time Remaining:
Description
Given two rectangles, find the total amount of area that overlaps.
Rectangles will be provided as a tuple of 4 integers: (x, y, width, height)
Write a function called findarea that takes in two of these tuples as input.
>>> findarea((10, 20, 50, 30), (30, 10, 10, 100))
300
300
Rectangles that do not overlap should return 0.
You must be logged in to submit an entry.