Possible Search Sequence

Question

Given a group of users. Each user has a time interval denoting the time range they use the search engine. Output the potential users for each search request.

Example

User 1: [1,10]
User 2: [2,4]
User 3: [6,7]
User 1: ----------
User 2:  ---  
User 3:      ---

Output: 
[[u1, u2],[u1,u2,u3]]

Solution

Last updated