appacademy / prep-work

preparatory material for interviewing with App Academy
291 stars 339 forks source link

Coding test 2 practice problem 07 #77

Closed ChristopherVH closed 9 years ago

ChristopherVH commented 9 years ago

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].

chasenyc commented 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.

ChristopherVH commented 9 years ago

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"?

rglassett commented 9 years ago

That's correct.