← 返回 snapchat 的题目列表Schedule Interview Matches
类型:online_judge
Given availability time slots for several interviewers and candidates, ensure each match is at least 100 time units. Output the matching result.
Input includes available time slots for interviewers and candidates, where each time slot is a pair of start and end times.
For example:
Interviewer interviewer1 is available for time slots [0, 300] and [500, 700]. Interviewer interviewer2 is available for time slots [200, 300] and [500, 700].
Candidate cand1 is available for time slots [200, 300] and [500, 700]. Candidate cand2 is available for time slots [200, 300] and [500, 700].
Output: For candidate cand1, the matches with interviewers and corresponding time slots are [{interviewer1, [200, 300]}, {interviewer2, [500, 600]}].
The solution needs to provide a clear input format, consider possible overlapping time slots, and efficiently perform the matching.
Example
Input
interviewers = {'interviewer1': [[0, 300], [500, 700]], 'interviewer2': [[200, 300], [500, 700]]}; candidates = {'cand1': [[200, 300], [500, 700]], 'cand2': [[200, 300], [500, 700]]}