Google | Phone | Rectangles Intersections
Anonymous User
3549

You will be given a list of rectangles, You have to return a list of overlapped rectangle pairs.

We don't need to return rectangle pairs. we just need to return labels of the rectangle pairs which are overlapping.
class Rectangle
{
int x1,x2,y1,y2;
String label;
}
public List<Pair<String,String>> getOverlapPairs(List.Rectangle. rectangles)
{
}

Found this video related to this problem with optimized solution: https://www.coursera.org/lecture/algorithms-part1/rectangle-intersection-mNiwq

Comments (7)