Skip to content

3169. Count Days Without Meetings #1473

Answered by mah-shamim
mah-shamim asked this question in Q&A
Discussion options

You must be logged in to vote

We need to determine the number of days an employee is available for work but has no meetings scheduled. The approach involves merging overlapping meetings and calculating the gaps between these merged meetings.

Approach

  1. Sort Meetings: First, we sort the meetings based on their start times to handle overlaps efficiently.
  2. Merge Overlapping Meetings: We then merge overlapping or adjacent meetings into non-overlapping intervals. This helps in accurately calculating the total days covered by meetings.
  3. Calculate Covered Days: Sum the days covered by each merged interval.
  4. Compute Result: Subtract the total covered days from the given total days to get the count of days without any meetings.

L…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@topugit
Comment options

topugit Mar 24, 2025
Collaborator

@mah-shamim
Comment options

mah-shamim Mar 24, 2025
Maintainer Author

Answer selected by topugit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested medium Difficulty
2 participants