Count Days Without Meetings

Try to solve the Count Days Without Meetings problem.

Statement

You are given a positive integer, days, which represents the total number of days an employee is available for work, starting from day 11. You are also given a 2D array, meetings, where each entry meetings[i] =[starti,endi]= [start_i, end_i] indicates that a meeting is scheduled from day startistart_i to day endiend_i (both inclusive).

Your task is to count the days when the employee is available for work but has no scheduled meetings.

Note: The meetings may overlap.

Constraints:

  • 1≤1 \leq days ≤100000\leq 100000

  • 1≤1 \leq meetings.length ≤1000\leq 1000

  • meetings[i].length ==2==2

  • 1≤1 \leq meetings[i][0] ≤\leq meetings[i][1] ≤\leq days

Examples

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.