I have been solving some problems recently and they tend to have the following query at the end:
Given n segments a1,a2
b1,b2
.
.
.
And some numbers of an array x1, x2, x3, . . .
I want to find the segments in which each of these numbers appear. There might be more than one segment so I want all the segments in which they appear.
How do I approach this question?
Thank you.