#K55572. Overlapping Tasks
Overlapping Tasks
Overlapping Tasks
Given a list of tasks assigned to employees, each task is represented by an employee ID, a start time, and an end time. An employee is considered to have overlapping tasks if there is at least one pair of tasks whose time intervals overlap. Two intervals \( [s_1, e_1] \) and \( [s_2, e_2] \) are said to overlap if \( s_1 < e_2 \) and \( s_2 < e_1 \). Your task is to identify all such employees and output their IDs in ascending order. If no employee has overlapping tasks, output an empty list.
inputFormat
The input is read from standard input (stdin). The first line contains an integer \(n\), the number of tasks. Each of the following \(n\) lines contains three integers separated by spaces: employee_id, start_time, and end_time.
outputFormat
Output to standard output (stdout) a list in Python list format (e.g., [1, 2]) containing the employee IDs with overlapping tasks in ascending order. If no employee qualifies, output an empty list: []
## sample4
1 900 1000
2 1000 1100
3 1100 1200
4 1300 1400
[]