Pergunta de entrevista da empresa Microsoft

how to find if two rectangles intersect

Resposta da entrevista

Sigiloso

7 de nov. de 2012

without using a data structure or a class for the rectangle //A(x1, y1) - coordinates for the top left edge //A(x2, y2) - coordinates for the bottom right edge bool isIntersecting(int aX1, int aX2, int aY1, int aY2, int bX1, int bX2, int bY1, int bY2) { return aX1 bX1 && aY1 bY1; }