algorithms.tutorialhorizon.com

Number of Intervals in which given value lies | Algorithms

iven a list of intervals with start and end for each interval. You have given a value V, write an algorithm to find the number of intervals in which the value V lies. Example: Given Interval: [[1,7], [3,10], [12,15]] Value : 6 lies in Intervals: 2