Company: Tower research_5sep
Difficulty: medium
Team Formation 3 Problem Description Given n employees, the time when the i -th employee starts working is represented by the array startTime[i] and the time when they finish the work is represented by the array endTime[i] . The i -th employee can interact with the j -th employee if their working hours overlap. A team can only be formed if at least one employee of the team can interact with all other team members. Determine the maximum size of such a team. Examples Example 1: Input: n = 5 startTime = [1, 6, 4, 3, 1] endTime = [2, 7, 5, 8, 2] Explanation: Consider the group [1, 2, 3]. Employee 3 can interact with other employees in the group, so a team of size 3 is possible. A team with more than 3 employees is impossible. Therefore, the answer is 3. Example 2 (Sample Input 0): Input: n = 4 startTime = [2, 5, 6, 8] endTime = [5, 6, 10, 9] Output: 3 Explanation: Employee 1 in the group [0, 1, 2] and employee 2 in the group [1, 2, 3] can each interact with the other two group members. Exa