a_left, a_bottom) and its upper-right corner (a_right, a_top); the second by its corners (b_left, b_bottom) and (b_right, b_top).
Return the area they cover together, counting any overlap only once.a_left=0, a_bottom=0, a_right=4, a_top=3, b_left=2, b_bottom=1, b_right=6, b_top=5 → 24
The areas are 12 and 16, and they share the square from (2, 1) to (4, 3) of area 4. In total 12 + 16 - 4 = 24.
a_left=-3, a_bottom=-3, a_right=-1, a_top=-1, b_left=1, b_bottom=0, b_right=2, b_top=5 → 9
The rectangles do not touch: 4 + 5 = 9.
a_left=0, a_bottom=0, a_right=10, a_top=10, b_left=2, b_bottom=2, b_right=5, b_top=5 → 100
a_left=0, a_bottom=0, a_right=4, a_top=3, b_left=2, b_bottom=1, b_right=6, b_top=5
24
Run checks the first 3 tests in your browser. Submit checks all 77 tests on the server, hidden ones included.