1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-22 13:36:46 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给定两个由一些<strong> 闭区间 </strong>组成的列表,<code>firstList</code> 和 <code>secondList</code> ,其中 <code>firstList[i] = [start<sub>i</sub>, end<sub>i</sub>]</code> 而 <code>secondList[j] = [start<sub>j</sub>, end<sub>j</sub>]</code> 。每个区间列表都是成对 <strong>不相交</strong> 的,并且 <strong>已经排序</strong> 。</p>\n\n<p>返回这 <strong>两个区间列表的交集</strong> 。</p>\n\n<p>形式上,<strong>闭区间</strong> <code>[a, b]</code>(其中 <code>a <= b</code>)表示实数 <code>x</code> 的集合,而 <code>a <= x <= b</code> 。</p>\n\n<p>两个闭区间的 <strong>交集</strong> 是一组实数,要么为空集,要么为闭区间。例如,<code>[1, 3]</code> 和 <code>[2, 4]</code> 的交集为 <code>[2, 3]</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2019/01/30/interval1.png\" style=\"width: 700px; height: 194px;\" />\n<pre>\n<strong>输入:</strong>firstList = [[0,2],[5,10],[13,23],[24,25]], secondList = [[1,5],[8,12],[15,24],[25,26]]\n<strong>输出:</strong>[[1,2],[5,5],[8,10],[15,23],[24,24],[25,25]]\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>firstList = [[1,3],[5,9]], secondList = []\n<strong>输出:</strong>[]\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>firstList = [], secondList = [[4,8],[10,12]]\n<strong>输出:</strong>[]\n</pre>\n\n<p><strong>示例 4</strong></p>\n\n<pre>\n<strong>输入:</strong>firstList = [[1,7]], secondList = [[3,10]]\n<strong>输出:</strong>[[3,7]]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= firstList.length, secondList.length <= 1000</code></li>\n\t<li><code>firstList.length + secondList.length >= 1</code></li>\n\t<li><code>0 <= start<sub>i</sub> < end<sub>i</sub> <= 10<sup>9</sup></code></li>\n\t<li><code>end<sub>i</sub> < start<sub>i+1</sub></code></li>\n\t<li><code>0 <= start<sub>j</sub> < end<sub>j</sub> <= 10<sup>9</sup> </code></li>\n\t<li><code>end<sub>j</sub> < start<sub>j+1</sub></code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 265,
"likes": 274,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Merge Intervals\", \"titleSlug\": \"merge-intervals\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u5408\\u5e76\\u533a\\u95f4\"}, {\"title\": \"Merge Sorted Array\", \"titleSlug\": \"merge-sorted-array\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u5408\\u5e76\\u4e24\\u4e2a\\u6709\\u5e8f\\u6570\\u7ec4\"}, {\"title\": \"Employee Free Time\", \"titleSlug\": \"employee-free-time\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u5458\\u5de5\\u7a7a\\u95f2\\u65f6\\u95f4\"}]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"39.2K\", \"totalSubmission\": \"57.5K\", \"totalAcceptedRaw\": 39231, \"totalSubmissionRaw\": 57482, \"acRate\": \"68.2%\"}",
"stats": "{\"totalAccepted\": \"41.9K\", \"totalSubmission\": \"61.3K\", \"totalAcceptedRaw\": 41879, \"totalSubmissionRaw\": 61264, \"acRate\": \"68.4%\"}",
"hints": [],
"solution": {
"id": "136",