File size: 247 Bytes
03a907a
 
 
 
1
2
3
4
5
def has_overlap(a: tuple[int, int], b: tuple[int, int]) -> bool:
    """Check if closed intervals [a0, a1] and [b0, b1] overlap."""
    # BUG: uses strict inequalities, missing touching-boundary overlap.
    return a[0] < b[1] and b[0] < a[1]