I have a searching problem like this:
"I have five lists of areas, namely list A, B, C, D and E. Each area has a radius and a center which occupies a round area in space. Let's place all areas in all lists on a 2-D map. Each overlaping region in a map is coded by the combination of names of the list of areas that creates the overlap (e.g., "ABCDE" or "ABDE"). How to find the overlapping regions with the the longest code? List them and their associated areas."
It seems like a 2-D version of this:
"Consider a big party where a log register for guest’s entry and exit times is maintained. Find the time at which there are maximum guests in the party. Note that entries in register are not in any order.
Example:
Input:
arrl[] = {1, 2, 9, 5, 5}
exit[] = {4, 5, 12, 9, 12}
First guest in array arrives at 1 and leaves at 4, second guest arrives at 2 and leaves at 5, and so on. "
And the answer is here: http://www.geeksforgeeks.org/find-the-point-where-maximum-intervals-overlap/
Anybody knows how to extend the answer to my original problem?
I can think of a brute force algorithm where I segment the whole map into many small squares and find the squares shadowed by the most areas. But it seems silly and time-consumming.
Thanks.