3169. Count Days Without Meetings Medium
1/**
2 * [3169] Count Days Without Meetings
3 *
4 * 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).
5 * Return the count of days when the employee is available for work but no meetings are scheduled.
6 * Note: The meetings may overlap.
7 *
8 * <strong class="example">Example 1:
9 * <div class="example-block">
10 * Input: <span class="example-io">days = 10, meetings = [[5,7],[1,3],[9,10]]</span>
11 * Output: <span class="example-io">2</span>
12 * Explanation:
13 * There is no meeting scheduled on the 4^th and 8^th days.
14 * </div>
15 * <strong class="example">Example 2:
16 * <div class="example-block">
17 * Input: <span class="example-io">days = 5, meetings = [[2,4],[1,3]]</span>
18 * Output: <span class="example-io">1</span>
19 * Explanation:
20 * There is no meeting scheduled on the 5^th day.
21 * </div>
22 * <strong class="example">Example 3:
23 * <div class="example-block">
24 * Input: <span class="example-io">days = 6, meetings = [[1,6]]</span>
25 * Output: 0
26 * Explanation:
27 * Meetings are scheduled for all working days.
28 * </div>
29 *
30 * Constraints:
31 *
32 * 1 <= days <= 10^9
33 * 1 <= meetings.length <= 10^5
34 * meetings[i].length == 2
35 * <font face="monospace">1 <= meetings[i][0] <= meetings[i][1] <= days</font>
36 *
37 */
38pub struct Solution {}
39
40// problem: https://leetcode.com/problems/count-days-without-meetings/
41// discuss: https://leetcode.com/problems/count-days-without-meetings/discuss/?currentPage=1&orderBy=most_votes&query=
42
43// submission codes start here
44
45impl Solution {
46 pub fn count_days(days: i32, meetings: Vec<Vec<i32>>) -> i32 {
47 0
48 }
49}
50
51// submission codes end
52
53#[cfg(test)]
54mod tests {
55 use super::*;
56
57 #[test]
58 fn test_3169() {
59 }
60}
61
Back
© 2025 bowen.ge All Rights Reserved.