Trains the technique from
LeetCode 3893Maximum Team Size with Overlapping IntervalsThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A depot logs one shift per worker. Worker i clocks on at minute startTime[i] and clocks off at minute endTime[i], and is counted as present at both of those minutes and at every minute between them.
A group of workers can hold a briefing when there is some minute at which every worker in the group is present. Return the size of the largest such group.
Example 1
At minute 9 the workers in slots 0, 1 and 2 are all present, since 9 lies inside each of their shifts, so those three can brief together. The worker in slot 3 is not present at minute 9.
Example 2
The first worker is present at minute 4 because a worker counts as present at the minute they clock off, and the second is present at minute 4 because that is when they clock on.
Example 3
No minute is covered by two of these shifts, so only a single worker can be present at once.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def largest_overlap_crew(startTime: list[int], endTime: list[int]) -> int:public int largestOverlapCrew(int[] startTime, int[] endTime)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.