Skip to content

3169. Count Days Without Meetings Date:24-03-2025 #18

Open
@iamAntimPal

Description

@iamAntimPal

Discussed in #17

Originally posted by iamAntimPal March 24, 2025

3169. Count Days Without Meetings

Problem Statement

You are given a positive integer days representing the total number of days an employee is available for work (starting from day 1). You are also given a 2D array meetings of size n where meetings[i] = [start_i, end_i] represents the starting and ending days of meeting i (inclusive).

Return the count of days when the employee is available for work but no meetings are scheduled.

Note: The meetings may overlap.


Example 1:

Input:

 days = 10, meetings = [[5,7],[1,3],[9,10]]

Output:

 2

Explanation:
There is no meeting scheduled on the 4th and 8th days.


Example 2:

Input:

 days = 5, meetings = [[2,4],[1,3]]

Output:

 1

Explanation:
There is no meeting scheduled on the 5th day.


Example 3:

Input:

 days = 6, meetings = [[1,6]]

Output:

 0

Explanation:
Meetings are scheduled for all working days.


Constraints:

  • 1 <= days <= 10^9
  • 1 <= meetings.length <= 10^5
  • meetings[i].length == 2
  • 1 <= meetings[i][0] <= meetings[i][1] <= days

Related Topics

  • Sorting
  • Interval Management
  • Set Operations

Steps to Push to GitHub:

  1. Create a new repository on GitHub.
  2. Clone the repository locally:
    git clone https://github.com/yourusername/repository-name.git
    cd repository-name
  3. Create a new file and add the solution:
    echo "# Count Days Without Meetings" > README.md
    nano solution.py  # Add the Python solution
  4. Add and commit changes:
    git add .
    git commit -m "Added solution for Count Days Without Meetings"
  5. Push to GitHub:
    git push origin main

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions