mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-25 17:50:26 +08:00
55 lines
1.7 KiB
HTML
55 lines
1.7 KiB
HTML
<p>给你一个正整数 <code>days</code>,表示员工可工作的总天数(从第 1 天开始)。另给你一个二维数组 <code>meetings</code>,长度为 <code>n</code>,其中 <code>meetings[i] = [start_i, end_i]</code> 表示第 <code>i</code> 次会议的开始和结束天数(包含首尾)。</p>
|
||
|
||
<p>返回员工可工作且没有安排会议的天数。</p>
|
||
|
||
<p><strong>注意:</strong>会议时间可能会有重叠。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong class="example">示例 1:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><strong>输入:</strong><span class="example-io">days = 10, meetings = [[5,7],[1,3],[9,10]]</span></p>
|
||
|
||
<p><strong>输出:</strong><span class="example-io">2</span></p>
|
||
|
||
<p><strong>解释:</strong></p>
|
||
|
||
<p>第 4 天和第 8 天没有安排会议。</p>
|
||
</div>
|
||
|
||
<p><strong class="example">示例 2:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><strong>输入:</strong><span class="example-io">days = 5, meetings = [[2,4],[1,3]]</span></p>
|
||
|
||
<p><strong>输出:</strong><span class="example-io">1</span></p>
|
||
|
||
<p><strong>解释:</strong></p>
|
||
|
||
<p>第 5 天没有安排会议。</p>
|
||
</div>
|
||
|
||
<p><strong class="example">示例 3:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><strong>输入:</strong><span class="example-io">days = 6, meetings = [[1,6]]</span></p>
|
||
|
||
<p><strong>输出:</strong>0</p>
|
||
|
||
<p><strong>解释:</strong></p>
|
||
|
||
<p>所有工作日都安排了会议。</p>
|
||
</div>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>1 <= days <= 10<sup>9</sup></code></li>
|
||
<li><code>1 <= meetings.length <= 10<sup>5</sup></code></li>
|
||
<li><code>meetings[i].length == 2</code></li>
|
||
<li><code>1 <= meetings[i][0] <= meetings[i][1] <= days</code></li>
|
||
</ul>
|