Closed ChristopherVH closed 9 years ago
I think you should try plotting this on a pad of paper or something. 2, 2 completely falls within both rectangles so it would definitely be part of the intersection.
Ohhh so it's more of a "return the corner points of the rectangle formed by the two overlapping" opposed to "the points where the two perimeters of the rectangles cross"?
That's correct.
I spent a while doing this problem prepping for the second coding test, and it appears that the complex case (fourth) is wrong as the intersections should be at [2,4], [3,4] not [2,2] [3,4].