⌘K
Flycodx

Interview Slot Scheduling Feasibility

Interview Slot Scheduling Feasibility

HardArrays100% accepted

A tech company in Pune schedules interviews for candidates. Each candidate has preferred time slots and each interviewer has available slots. Determine if all candidates can be uniquely assigned to interviewers where both candidate and interviewer are available. Rule: candidate slot [s1,e1] is compatible with interviewer slot [s2,e2] when they overlap (s1<e2 and s2<e1). Each interviewer takes at most one candidate. Return 'true' if every candidate can be uniquely assigned, else 'false'. Your solve(...) function receives the inputs as ready-made arguments — no input reading or parsing needed; just return the answer.

Approach

Given candidate preferred slots and interviewer available slots, check if all candidates can be uniquely matched to interviewers.

Input

candidates=[[9,10],[10,11]] interviewers=[[9,11],[10,12]]

Output

true
solution.py
Loading editor...
Test 1
Test 2
Test 3

Press Run to test your custom input, or Submit to judge against all test cases.

Sign in to continue

Create a free account to run code, submit solutions and track progress.

  • Free forever — no credit card
  • 10+ languages with live execution
  • Points, streaks & leaderboards
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3