Challenge: Organizing a Lottery

Solve the Points and Segments Problem.

We'll cover the following

Problem


Points and Segments Problem

Given a set of points and a set of segments on a line, compute for each point the number of segments it’s contained in.

Input: A list of nn segments and a list of mm points.

Output: The number of segments containing each point.


Level up your interview prep. Join Educative to access 80+ hands-on prep courses.