Given the set of intervals [x,y] where 0 <= x,y <= 2000 , how can I find the minimum number of points that can cover (that is, each interval must contain at least one point in the resulting set of points) all intervals?
Example:
Given Set of intervals: [2,5] [3,7] [7,10]
then the answer should be 2 (the minimum number of points needed to cover all intervals), since the points x=3,x=7 are one of the solutions.
Parth source share