def intersect(a, b):
if a[x0] == a[x1] or a[y0] == a[y1]:<EOL><INDENT>return False<EOL><DEDENT>if b[x0] == b[x1] or b[y0] == b[y1]:<EOL><INDENT>return False<EOL><DEDENT>return a[x0] <= b[x1] and b[x0] <= a[x1] and a[y0] <= b[y1] and b[y0] <= a[y1]<EOL>
Check if two rectangles intersect