Given a set of pairs. Each pair represent a range of numbers. Example : (5, 8) represents {5, 6, 7, 8}. I want to find in which pair an element x is present, it is sure that element x exits in at least one pair? Can this be solved in logarithmic time? Thanks in advance! asked 28 Jan '18, 05:02

There must be some other constraints too else this would be a very easy problem.Just take min and max value of the set.That would be your answer. answered 28 Jan '18, 08:58

is there are overlapping pairs?
Sort, join overlapping pairs, binary search.
Can you please paste the exact link of question? It will help us to sort out weather it is genuine question or it is not taken from any ongoing contest.