The working period consists of the integer days from 1 through days, inclusive. Each entry [start, end] in meetings marks every day from start through end as occupied, including both endpoints. Meetings may overlap or repeat. Return the number of days in the working period that are not covered by any meeting.
Example 1:
Input: days = 8
meetings = [[2,3],[3,5]]
Output: 4Explanation: The meetings overlap on day 3 and together occupy days 2 through 5. Days 1, 6, 7, and 8 remain free, giving 4 days.
Example 2:
Input: days = 6
meetings = [[1,2],[3,6]]
Output: 0Explanation: The first meeting covers days 1 and 2, and the second covers days 3 through 6. Every working day is occupied, so return 0.
Example 3:
Input: days = 9
meetings = [[4,4],[4,4]]
Output: 8Explanation: Both meetings occupy the same single day, day 4. Count that day only once; the other eight days remain free.
Constraints:
1 <= days <= 10000000001 <= meetings.length <= 100000- Each meeting has exactly two endpoints.
1 <= start <= end <= daysfor every meeting.