Company: Tower research_5sep
Difficulty: medium
Team Formation 3 Problem Description There are n employees at a company. Employee i clocks in at startTime[i] and clocks out at endTime[i] . Employee i is able to communicate with employee j whenever their two working windows overlap. A group of employees can be organized into a team only if it contains at least one member who can communicate with every other member of that team. Find the largest team size that can be organized this way. Examples Example 1: Input: n = 5 startTime = [1, 6, 4, 3, 1] endTime = [2, 7, 5, 8, 2] Explanation: Take the group [1, 2, 3]. Employee 3 overlaps with both of the other two, so a team of 3 works. No grouping of 4 or more employees satisfies the rule, so 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 can serve as the connecting member for group [0, 1, 2], and employee 2 can serve the same role for group [1, 2, 3] - both are valid teams of size 3. Example 3 (Sam