1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/删除被覆盖区间 [remove-covered-intervals].html
2022-03-29 12:43:11 +08:00

26 lines
920 B
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个区间列表,请你删除列表中被其他区间所覆盖的区间。</p>
<p>只有当&nbsp;<code>c &lt;= a</code>&nbsp;&nbsp;<code>b &lt;= d</code>&nbsp;时,我们才认为区间&nbsp;<code>[a,b)</code> 被区间&nbsp;<code>[c,d)</code> 覆盖。</p>
<p>在完成所有删除操作后,请你返回列表中剩余区间的数目。</p>
<p>&nbsp;</p>
<p><strong>示例:</strong></p>
<pre>
<strong>输入:</strong>intervals = [[1,4],[3,6],[2,8]]
<strong>输出:</strong>2
<strong>解释:</strong>区间 [3,6] 被区间 [2,8] 覆盖,所以它被删除了。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= intervals.length &lt;= 1000</code></li>
<li><code>0 &lt;= intervals[i][0] &lt;&nbsp;intervals[i][1] &lt;= 10^5</code></li>
<li>对于所有的&nbsp;<code>i != j</code><code>intervals[i] != intervals[j]</code></li>
</ul>