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]