Problem statement

https://binarysearch.com/problems/Rectangular-Overlap/

Solution

It is equal to Leetcode 0836 Rectangle Overlap.

Complexity

It is O(1) for time and space.

Code

class Solution:
    def solve(self, rect0, rect1):
        A, B, C, D = rect0
        E, F, G, H = rect1
        return not min(C,G) <= max(A,E) and not min(D,H) <= max(B,F)