update algorithm tree structure

上级 e6df4764
无相关合并请求

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
......@@ -2,5 +2,5 @@
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "852817b216ad4b69829c52281a508f9f"
"exercise_id": "ec152c655c29427784bad8e2b097be6a"
}
\ No newline at end of file
# 两数之和
<p>给定一个整数数组 <code>nums</code> 和一个整数目标值 <code>target</code>,请你在该数组中找出 <strong>和为目标值</strong> 的那 <strong>两个</strong> 整数,并返回它们的数组下标。</p><p>你可以假设每种输入只会对应一个答案。但是,数组中同一个元素在答案里不能重复出现。</p><p>你可以按任意顺序返回答案。</p><p> </p><p><strong>示例 1:</strong></p><pre><strong>输入:</strong>nums = [2,7,11,15], target = 9<strong><br />输出:</strong>[0,1]<strong><br />解释:</strong>因为 nums[0] + nums[1] == 9 ,返回 [0, 1] 。</pre><p><strong>示例 2:</strong></p><pre><strong>输入:</strong>nums = [3,2,4], target = 6<strong><br />输出:</strong>[1,2]</pre><p><strong>示例 3:</strong></p><pre><strong>输入:</strong>nums = [3,3], target = 6<strong><br />输出:</strong>[0,1]</pre><p> </p><p><strong>提示:</strong></p><ul> <li><code>2 <= nums.length <= 10<sup>3</sup></code></li> <li><code>-10<sup>9</sup> <= nums[i] <= 10<sup>9</sup></code></li> <li><code>-10<sup>9</sup> <= target <= 10<sup>9</sup></code></li> <li><strong>只会存在一个有效答案</strong></li></ul>
<p><p>给定一个整数数组 <code>nums</code> 和一个整数目标值 <code>target</code>,请你在该数组中找出 <strong>和为目标值</strong> 的那 <strong>两个</strong> 整数,并返回它们的数组下标。</p><p>你可以假设每种输入只会对应一个答案。但是,数组中同一个元素在答案里不能重复出现。</p><p>你可以按任意顺序返回答案。</p><p> </p><p><strong>示例 1:</strong></p><pre><strong>输入:</strong>nums = [2,7,11,15], target = 9<strong><br />输出:</strong>[0,1]<strong><br />解释:</strong>因为 nums[0] + nums[1] == 9 ,返回 [0, 1] 。</pre><p><strong>示例 2:</strong></p><pre><strong>输入:</strong>nums = [3,2,4], target = 6<strong><br />输出:</strong>[1,2]</pre><p><strong>示例 3:</strong></p><pre><strong>输入:</strong>nums = [3,3], target = 6<strong><br />输出:</strong>[0,1]</pre><p> </p><p><strong>提示:</strong></p><ul> <li><code>2 <= nums.length <= 10<sup>3</sup></code></li> <li><code>-10<sup>9</sup> <= nums[i] <= 10<sup>9</sup></code></li> <li><code>-10<sup>9</sup> <= target <= 10<sup>9</sup></code></li> <li><strong>只会存在一个有效答案</strong></li></ul>
<p>以下错误的选项是?</p></p>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"对称二叉树"
],
"children": [],
"export": [
"solution.json"
],
"title": "对称二叉树"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "f1ce32e09e1e4a6baa582a6432191e67"
}
\ No newline at end of file
# 对称二叉树
以下错误的选项是?
<p>给定一个二叉树,检查它是否是镜像对称的。</p>
<p>&nbsp;</p>
<p>例如,二叉树&nbsp;<code>[1,2,2,3,4,4,3]</code> 是对称的。</p>
<pre> 1
/ \
2 2
/ \ / \
3 4 4 3
</pre>
<p>&nbsp;</p>
<p>但是下面这个&nbsp;<code>[1,2,2,null,3,null,3]</code> 则不是镜像对称的:</p>
<pre> 1
/ \
2 2
\ \
3 3
</pre>
<p>&nbsp;</p>
<p><strong>进阶:</strong></p>
<p>你可以运用递归和迭代两种方法解决这个问题吗?</p>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"二叉树的层序遍历"
],
"children": [],
"export": [
"solution.json"
],
"title": "二叉树的层序遍历"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "9290e1345143424f8a116ab56f88f50e"
}
\ No newline at end of file
# 二叉树的层序遍历
以下错误的选项是?
<p>给你一个二叉树,请你返回其按 <strong>层序遍历</strong> 得到的节点值。 (即逐层地,从左到右访问所有节点)。</p>
<p> </p>
<p><strong>示例:</strong><br />
二叉树:<code>[3,9,20,null,null,15,7]</code>,</p>
<pre>
3
/ \
9 20
/ \
15 7
</pre>
<p>返回其层序遍历结果:</p>
<pre>
[
[3],
[9,20],
[15,7]
]
</pre>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"二叉树的锯齿形层序遍历"
],
"children": [],
"export": [
"solution.json"
],
"title": "二叉树的锯齿形层序遍历"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "d55fa143ea4b4a9b9cfc24a1e68e0e64"
}
\ No newline at end of file
# 二叉树的锯齿形层序遍历
以下错误的选项是?
<p>给定一个二叉树,返回其节点值的锯齿形层序遍历。(即先从左往右,再从右往左进行下一层遍历,以此类推,层与层之间交替进行)。</p>
<p>例如:<br />
给定二叉树 <code>[3,9,20,null,null,15,7]</code>,</p>
<pre>
3
/ \
9 20
/ \
15 7
</pre>
<p>返回锯齿形层序遍历如下:</p>
<pre>
[
[3],
[20,9],
[15,7]
]
</pre>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"二叉树的最大深度"
],
"children": [],
"export": [
"solution.json"
],
"title": "二叉树的最大深度"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "d4405493ff00470fb08f29109f7b68ce"
}
\ No newline at end of file
# 二叉树的最大深度
以下错误的选项是?
<p>给定一个二叉树,找出其最大深度。</p>
<p>二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。</p>
<p><strong>说明:</strong>&nbsp;叶子节点是指没有子节点的节点。</p>
<p><strong>示例:</strong><br>
给定二叉树 <code>[3,9,20,null,null,15,7]</code></p>
<pre> 3
/ \
9 20
/ \
15 7</pre>
<p>返回它的最大深度&nbsp;3 。</p>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"从前序与中序遍历序列构造二叉树"
],
"children": [],
"export": [
"solution.json"
],
"title": "从前序与中序遍历序列构造二叉树"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "8f908ed43ce64c4dbbc1678a7428e948"
}
\ No newline at end of file
# 从前序与中序遍历序列构造二叉树
以下错误的选项是?
<p>给定一棵树的前序遍历 <code>preorder</code> 与中序遍历  <code>inorder</code>。请构造二叉树并返回其根节点。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/02/19/tree.jpg" />
<pre>
<strong>Input:</strong> preorder = [3,9,20,15,7], inorder = [9,3,15,20,7]
<strong>Output:</strong> [3,9,20,null,null,15,7]
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>Input:</strong> preorder = [-1], inorder = [-1]
<strong>Output:</strong> [-1]
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= preorder.length <= 3000</code></li>
<li><code>inorder.length == preorder.length</code></li>
<li><code>-3000 <= preorder[i], inorder[i] <= 3000</code></li>
<li><code>preorder</code> 和 <code>inorder</code> 均无重复元素</li>
<li><code>inorder</code> 均出现在 <code>preorder</code></li>
<li><code>preorder</code> 保证为二叉树的前序遍历序列</li>
<li><code>inorder</code> 保证为二叉树的中序遍历序列</li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"从中序与后序遍历序列构造二叉树"
],
"children": [],
"export": [
"solution.json"
],
"title": "从中序与后序遍历序列构造二叉树"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "8ee984b6cbf14006a2e98997069b4dc4"
}
\ No newline at end of file
# 从中序与后序遍历序列构造二叉树
以下错误的选项是?
<p>根据一棵树的中序遍历与后序遍历构造二叉树。</p>
<p><strong>注意:</strong><br>
你可以假设树中没有重复的元素。</p>
<p>例如,给出</p>
<pre>中序遍历 inorder =&nbsp;[9,3,15,20,7]
后序遍历 postorder = [9,15,7,20,3]</pre>
<p>返回如下的二叉树:</p>
<pre> 3
/ \
9 20
/ \
15 7
</pre>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"二叉树的层序遍历 II"
],
"children": [],
"export": [
"solution.json"
],
"title": "二叉树的层序遍历 II"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "3522ee5b49db49e59cbba1f8746ee9f2"
}
\ No newline at end of file
# 二叉树的层序遍历 II
以下错误的选项是?
<p>给定一个二叉树,返回其节点值自底向上的层序遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历)</p>
<p>例如:<br />
给定二叉树 <code>[3,9,20,null,null,15,7]</code>,</p>
<pre>
3
/ \
9 20
/ \
15 7
</pre>
<p>返回其自底向上的层序遍历为:</p>
<pre>
[
[15,7],
[9,20],
[3]
]
</pre>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"将有序数组转换为二叉搜索树"
],
"children": [],
"export": [
"solution.json"
],
"title": "将有序数组转换为二叉搜索树"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "67d0973286b04e01985a6439cde4be31"
}
\ No newline at end of file
# 将有序数组转换为二叉搜索树
以下错误的选项是?
<p>给你一个整数数组 <code>nums</code> ,其中元素已经按 <strong>升序</strong> 排列,请你将其转换为一棵 <strong>高度平衡</strong> 二叉搜索树。</p>
<p><strong>高度平衡 </strong>二叉树是一棵满足「每个节点的左右两个子树的高度差的绝对值不超过 1 」的二叉树。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/02/18/btree1.jpg" style="width: 302px; height: 222px;" />
<pre>
<strong>输入:</strong>nums = [-10,-3,0,5,9]
<strong>输出:</strong>[0,-3,9,-10,null,5]
<strong>解释:</strong>[0,-10,5,null,-3,null,9] 也将被视为正确答案:
<img alt="" src="https://assets.leetcode.com/uploads/2021/02/18/btree2.jpg" style="width: 302px; height: 222px;" />
</pre>
<p><strong>示例 2:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/02/18/btree.jpg" style="width: 342px; height: 142px;" />
<pre>
<strong>输入:</strong>nums = [1,3]
<strong>输出:</strong>[3,1]
<strong>解释:</strong>[1,3] 和 [3,1] 都是高度平衡二叉搜索树。
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= nums.length <= 10<sup>4</sup></code></li>
<li><code>-10<sup>4</sup> <= nums[i] <= 10<sup>4</sup></code></li>
<li><code>nums</code><strong>严格递增</strong> 顺序排列</li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"有序链表转换二叉搜索树"
],
"children": [],
"export": [
"solution.json"
],
"title": "有序链表转换二叉搜索树"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "46e1f6d1b2ea4ddfbce9f0b7937618c3"
}
\ No newline at end of file
# 有序链表转换二叉搜索树
以下错误的选项是?
<p>给定一个单链表,其中的元素按升序排序,将其转换为高度平衡的二叉搜索树。</p>
<p>本题中,一个高度平衡二叉树是指一个二叉树<em>每个节点&nbsp;</em>的左右两个子树的高度差的绝对值不超过 1。</p>
<p><strong>示例:</strong></p>
<pre>给定的有序链表: [-10, -3, 0, 5, 9],
一个可能的答案是:[0, -3, 9, -10, null, 5], 它可以表示下面这个高度平衡二叉搜索树:
0
/ \
-3 9
/ /
-10 5
</pre>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"平衡二叉树"
],
"children": [],
"export": [
"solution.json"
],
"title": "平衡二叉树"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "349b24e6729544c3a3b27f925f0c1b98"
}
\ No newline at end of file
# 平衡二叉树
以下错误的选项是?
<p>给定一个二叉树,判断它是否是高度平衡的二叉树。</p>
<p>本题中,一棵高度平衡二叉树定义为:</p>
<blockquote>
<p>一个二叉树<em>每个节点 </em>的左右两个子树的高度差的绝对值不超过 1 。</p>
</blockquote>
<p> </p>
<p><strong>示例 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/06/balance_1.jpg" style="width: 342px; height: 221px;" />
<pre>
<strong>输入:</strong>root = [3,9,20,null,null,15,7]
<strong>输出:</strong>true
</pre>
<p><strong>示例 2:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/06/balance_2.jpg" style="width: 452px; height: 301px;" />
<pre>
<strong>输入:</strong>root = [1,2,2,3,3,null,null,4,4]
<strong>输出:</strong>false
</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong>root = []
<strong>输出:</strong>true
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>树中的节点数在范围 <code>[0, 5000]</code></li>
<li><code>-10<sup>4</sup> <= Node.val <= 10<sup>4</sup></code></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
......@@ -2,5 +2,5 @@
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "52fee70ba9b649ffbcfca6fd3bf96ff6"
"exercise_id": "948a23a3a42a470b8e42748d23fc1fc8"
}
\ No newline at end of file
# 盛最多水的容器
<p>给你 <code>n</code> 个非负整数 <code>a<sub>1</sub>,a<sub>2,</sub>...,a</code><sub><code>n</code>,</sub>每个数代表坐标中的一个点 <code>(i, a<sub>i</sub>)</code> 。在坐标内画 <code>n</code> 条垂直线,垂直线 <code>i</code> 的两个端点分别为 <code>(i, a<sub>i</sub>)</code> 和 <code>(i, 0)</code> 。找出其中的两条线,使得它们与 <code>x</code> 轴共同构成的容器可以容纳最多的水。</p><p><strong>说明:</strong>你不能倾斜容器。</p><p> </p><p><strong>示例 1:</strong></p><p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0011.Container%20With%20Most%20Water/images/question_11.jpg" style="height: 287px; width: 600px;" /></p><pre><strong>输入:</strong>[1,8,6,2,5,4,8,3,7]<strong><br />输出:</strong>49 <strong><br />解释:</strong>图中垂直线代表输入数组 [1,8,6,2,5,4,8,3,7]。在此情况下,容器能够容纳水(表示为蓝色部分)的最大值为 49。</pre><p><strong>示例 2:</strong></p><pre><strong>输入:</strong>height = [1,1]<strong><br />输出:</strong>1</pre><p><strong>示例 3:</strong></p><pre><strong>输入:</strong>height = [4,3,2,1,4]<strong><br />输出:</strong>16</pre><p><strong>示例 4:</strong></p><pre><strong>输入:</strong>height = [1,2,1]<strong><br />输出:</strong>2</pre><p> </p><p><strong>提示:</strong></p><ul> <li><code>n = height.length</code></li> <li><code>2 <= n <= 3 * 10<sup>4</sup></code></li> <li><code>0 <= height[i] <= 3 * 10<sup>4</sup></code></li></ul>
<p><p>给你 <code>n</code> 个非负整数 <code>a<sub>1</sub>,a<sub>2,</sub>...,a</code><sub><code>n</code>,</sub>每个数代表坐标中的一个点 <code>(i, a<sub>i</sub>)</code> 。在坐标内画 <code>n</code> 条垂直线,垂直线 <code>i</code> 的两个端点分别为 <code>(i, a<sub>i</sub>)</code> 和 <code>(i, 0)</code> 。找出其中的两条线,使得它们与 <code>x</code> 轴共同构成的容器可以容纳最多的水。</p><p><strong>说明:</strong>你不能倾斜容器。</p><p> </p><p><strong>示例 1:</strong></p><p><img alt="" src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0011.Container%20With%20Most%20Water/images/question_11.jpg" style="height: 287px; width: 600px;" /></p><pre><strong>输入:</strong>[1,8,6,2,5,4,8,3,7]<strong><br />输出:</strong>49 <strong><br />解释:</strong>图中垂直线代表输入数组 [1,8,6,2,5,4,8,3,7]。在此情况下,容器能够容纳水(表示为蓝色部分)的最大值为 49。</pre><p><strong>示例 2:</strong></p><pre><strong>输入:</strong>height = [1,1]<strong><br />输出:</strong>1</pre><p><strong>示例 3:</strong></p><pre><strong>输入:</strong>height = [4,3,2,1,4]<strong><br />输出:</strong>16</pre><p><strong>示例 4:</strong></p><pre><strong>输入:</strong>height = [1,2,1]<strong><br />输出:</strong>2</pre><p> </p><p><strong>提示:</strong></p><ul> <li><code>n = height.length</code></li> <li><code>2 <= n <= 3 * 10<sup>4</sup></code></li> <li><code>0 <= height[i] <= 3 * 10<sup>4</sup></code></li></ul>
<p>以下错误的选项是?</p></p>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"二叉树的最小深度"
],
"children": [],
"export": [
"solution.json"
],
"title": "二叉树的最小深度"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "d191dec01b78497fb0c63897d37fb895"
}
\ No newline at end of file
# 二叉树的最小深度
以下错误的选项是?
<p>给定一个二叉树,找出其最小深度。</p>
<p>最小深度是从根节点到最近叶子节点的最短路径上的节点数量。</p>
<p><strong>说明:</strong>叶子节点是指没有子节点的节点。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/12/ex_depth.jpg" style="width: 432px; height: 302px;" />
<pre>
<strong>输入:</strong>root = [3,9,20,null,null,15,7]
<strong>输出:</strong>2
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>root = [2,null,3,null,4,null,5,null,6]
<strong>输出:</strong>5
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点数的范围在 <code>[0, 10<sup>5</sup>]</code></li>
<li><code>-1000 <= Node.val <= 1000</code></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"路径总和"
],
"children": [],
"export": [
"solution.json"
],
"title": "路径总和"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "544c6d3b7e0d4116b27d5fdb8691a522"
}
\ No newline at end of file
# 路径总和
以下错误的选项是?
<p>给你二叉树的根节点 <code>root</code> 和一个表示目标和的整数 <code>targetSum</code> ,判断该树中是否存在 <strong>根节点到叶子节点</strong> 的路径,这条路径上所有节点值相加等于目标和 <code>targetSum</code></p>
<p><strong>叶子节点</strong> 是指没有子节点的节点。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/01/18/pathsum1.jpg" style="width: 500px; height: 356px;" />
<pre>
<strong>输入:</strong>root = [5,4,8,11,null,13,4,7,2,null,null,null,1], targetSum = 22
<strong>输出:</strong>true
</pre>
<p><strong>示例 2:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/01/18/pathsum2.jpg" />
<pre>
<strong>输入:</strong>root = [1,2,3], targetSum = 5
<strong>输出:</strong>false
</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong>root = [1,2], targetSum = 0
<strong>输出:</strong>false
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点的数目在范围 <code>[0, 5000]</code></li>
<li><code>-1000 <= Node.val <= 1000</code></li>
<li><code>-1000 <= targetSum <= 1000</code></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"路径总和 II"
],
"children": [],
"export": [
"solution.json"
],
"title": "路径总和 II"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "cebd88413a964aeca882afdf79cb545a"
}
\ No newline at end of file
# 路径总和 II
以下错误的选项是?
<p>给你二叉树的根节点 <code>root</code> 和一个整数目标和 <code>targetSum</code> ,找出所有 <strong>从根节点到叶子节点</strong> 路径总和等于给定目标和的路径。</p>
<p><strong>叶子节点</strong> 是指没有子节点的节点。</p>
<div class="original__bRMd">
<div>
<p> </p>
<p><strong>示例 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/01/18/pathsumii1.jpg" style="width: 500px; height: 356px;" />
<pre>
<strong>输入:</strong>root = [5,4,8,11,null,13,4,7,2,null,null,5,1], targetSum = 22
<strong>输出:</strong>[[5,4,11,2],[5,8,4,5]]
</pre>
<p><strong>示例 2:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/01/18/pathsum2.jpg" style="width: 212px; height: 181px;" />
<pre>
<strong>输入:</strong>root = [1,2,3], targetSum = 5
<strong>输出:</strong>[]
</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong>root = [1,2], targetSum = 0
<strong>输出:</strong>[]
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点总数在范围 <code>[0, 5000]</code></li>
<li><code>-1000 <= Node.val <= 1000</code></li>
<li><code>-1000 <= targetSum <= 1000</code></li>
</ul>
</div>
</div>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"二叉树展开为链表"
],
"children": [],
"export": [
"solution.json"
],
"title": "二叉树展开为链表"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "ff78d2cb32c54b4aa7b81a9d1460c414"
}
\ No newline at end of file
# 二叉树展开为链表
以下错误的选项是?
<p>给你二叉树的根结点 <code>root</code> ,请你将它展开为一个单链表:</p>
<ul>
<li>展开后的单链表应该同样使用 <code>TreeNode</code> ,其中 <code>right</code> 子指针指向链表中下一个结点,而左子指针始终为 <code>null</code></li>
<li>展开后的单链表应该与二叉树 <a href="https://baike.baidu.com/item/%E5%85%88%E5%BA%8F%E9%81%8D%E5%8E%86/6442839?fr=aladdin" target="_blank"><strong>先序遍历</strong></a> 顺序相同。</li>
</ul>
<p> </p>
<p><strong>示例 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/01/14/flaten.jpg" style="width: 500px; height: 226px;" />
<pre>
<strong>输入:</strong>root = [1,2,5,3,4,null,6]
<strong>输出:</strong>[1,null,2,null,3,null,4,null,5,null,6]
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>root = []
<strong>输出:</strong>[]
</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong>root = [0]
<strong>输出:</strong>[0]
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>树中结点数在范围 <code>[0, 2000]</code></li>
<li><code>-100 <= Node.val <= 100</code></li>
</ul>
<p> </p>
<p><strong>进阶:</strong>你可以使用原地算法(<code>O(1)</code> 额外空间)展开这棵树吗?</p>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"不同的子序列"
],
"children": [],
"export": [
"solution.json"
],
"title": "不同的子序列"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "09986605839149aaa236fd434e229597"
}
\ No newline at end of file
# 不同的子序列
以下错误的选项是?
<p>给定一个字符串 <code>s</code><strong> </strong>和一个字符串 <code>t</code> ,计算在 <code>s</code> 的子序列中 <code>t</code> 出现的个数。</p>
<p>字符串的一个 <strong>子序列</strong> 是指,通过删除一些(也可以不删除)字符且不干扰剩余字符相对位置所组成的新字符串。(例如,<code>"ACE"</code> 是 <code>"ABCDE"</code> 的一个子序列,而 <code>"AEC"</code> 不是)</p>
<p>题目数据保证答案符合 32 位带符号整数范围。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong>s = "rabbbit", t = "rabbit"<code>
<strong>输出</strong></code><strong></strong><code>3
</code><strong>解释:</strong>
如下图所示, 有 3 种可以从 s 中得到 <code>"rabbit" 的方案</code>
<code><strong><u>rabb</u></strong>b<strong><u>it</u></strong></code>
<code><strong><u>ra</u></strong>b<strong><u>bbit</u></strong></code>
<code><strong><u>rab</u></strong>b<strong><u>bit</u></strong></code></pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>s = "babgbag", t = "bag"
<code><strong>输出</strong></code><strong></strong><code>5
</code><strong>解释:</strong>
如下图所示, 有 5 种可以从 s 中得到 <code>"bag" 的方案</code>
<code><strong><u>ba</u></strong>b<u><strong>g</strong></u>bag</code>
<code><strong><u>ba</u></strong>bgba<strong><u>g</u></strong></code>
<code><u><strong>b</strong></u>abgb<strong><u>ag</u></strong></code>
<code>ba<u><strong>b</strong></u>gb<u><strong>ag</strong></u></code>
<code>babg<strong><u>bag</u></strong></code>
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 <= s.length, t.length <= 1000</code></li>
<li><code>s</code><code>t</code> 由英文字母组成</li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"填充每个节点的下一个右侧节点指针"
],
"children": [],
"export": [
"solution.json"
],
"title": "填充每个节点的下一个右侧节点指针"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "6d660f34bef54305876cbe888e276745"
}
\ No newline at end of file
# 填充每个节点的下一个右侧节点指针
以下错误的选项是?
<p>给定一个 <strong>完美二叉树 </strong>,其所有叶子节点都在同一层,每个父节点都有两个子节点。二叉树定义如下:</p>
<pre>
struct Node {
int val;
Node *left;
Node *right;
Node *next;
}</pre>
<p>填充它的每个 next 指针,让这个指针指向其下一个右侧节点。如果找不到下一个右侧节点,则将 next 指针设置为 <code>NULL</code></p>
<p>初始状态下,所有 next 指针都被设置为 <code>NULL</code></p>
<p> </p>
<p><strong>进阶:</strong></p>
<ul>
<li>你只能使用常量级额外空间。</li>
<li>使用递归解题也符合要求,本题中递归程序占用的栈空间不算做额外的空间复杂度。</li>
</ul>
<p> </p>
<p><strong>示例:</strong></p>
<p><img alt="" src="https://assets.leetcode.com/uploads/2019/02/14/116_sample.png" style="height: 205px; width: 600px;" /></p>
<pre>
<b>输入:</b>root = [1,2,3,4,5,6,7]
<b>输出:</b>[1,#,2,3,#,4,5,6,7,#]
<b>解释:</b>给定二叉树如图 A 所示,你的函数应该填充它的每个 next 指针,以指向其下一个右侧节点,如图 B 所示。序列化的输出按层序遍历排列,同一层节点由 next 指针连接,'#' 标志着每一层的结束。
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点的数量少于 <code>4096</code></li>
<li><code>-1000 <= node.val <= 1000</code></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"填充每个节点的下一个右侧节点指针 II"
],
"children": [],
"export": [
"solution.json"
],
"title": "填充每个节点的下一个右侧节点指针 II"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "75e2fe61ebdb481987a54b0c18811f9b"
}
\ No newline at end of file
# 填充每个节点的下一个右侧节点指针 II
以下错误的选项是?
<p>给定一个二叉树</p>
<pre>
struct Node {
int val;
Node *left;
Node *right;
Node *next;
}</pre>
<p>填充它的每个 next 指针,让这个指针指向其下一个右侧节点。如果找不到下一个右侧节点,则将 next 指针设置为 <code>NULL</code></p>
<p>初始状态下,所有 next 指针都被设置为 <code>NULL</code></p>
<p> </p>
<p><strong>进阶:</strong></p>
<ul>
<li>你只能使用常量级额外空间。</li>
<li>使用递归解题也符合要求,本题中递归程序占用的栈空间不算做额外的空间复杂度。</li>
</ul>
<p> </p>
<p><strong>示例:</strong></p>
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/02/15/117_sample.png" style="height: 218px; width: 640px;" /></p>
<pre>
<strong>输入</strong>:root = [1,2,3,4,5,null,7]
<strong>输出:</strong>[1,#,2,3,#,4,5,7,#]
<strong>解释:</strong>给定二叉树如图 A 所示,你的函数应该填充它的每个 next 指针,以指向其下一个右侧节点,如图 B 所示。序列化输出按层序遍历顺序(由 next 指针连接),'#' 表示每层的末尾。</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>树中的节点数小于 <code>6000</code></li>
<li><code>-100 <= node.val <= 100</code></li>
</ul>
<p> </p>
<ul>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"杨辉三角"
],
"children": [],
"export": [
"solution.json"
],
"title": "杨辉三角"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "dba4796c50e442b29b123edad8e14028"
}
\ No newline at end of file
# 杨辉三角
以下错误的选项是?
<p>给定一个非负整数 <em><code>numRows</code></em>生成「杨辉三角」的前 <em><code>numRows</code> </em>行。</p>
<p><small>在「杨辉三角」中,每个数是它左上方和右上方的数的和。</small></p>
<p><img alt="" src="https://pic.leetcode-cn.com/1626927345-DZmfxB-PascalTriangleAnimated2.gif" /></p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong> numRows = 5
<strong>输出:</strong> [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong> numRows = 1
<strong>输出:</strong> [[1]]
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= numRows <= 30</code></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"杨辉三角 II"
],
"children": [],
"export": [
"solution.json"
],
"title": "杨辉三角 II"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "63a645be30244fd388bac74952cc7aea"
}
\ No newline at end of file
# 杨辉三角 II
以下错误的选项是?
<p>给定一个非负索引 <code>rowIndex</code>,返回「杨辉三角」的第 <code>rowIndex</code><em> </em>行。</p>
<p><small>在「杨辉三角」中,每个数是它左上方和右上方的数的和。</small></p>
<p><img alt="" src="https://pic.leetcode-cn.com/1626927345-DZmfxB-PascalTriangleAnimated2.gif" /></p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong> rowIndex = 3
<strong>输出:</strong> [1,3,3,1]
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong> rowIndex = 0
<strong>输出:</strong> [1]
</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong> rowIndex = 1
<strong>输出:</strong> [1,1]
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 <= rowIndex <= 33</code></li>
</ul>
<p> </p>
<p><strong>进阶:</strong></p>
<p>你可以优化你的算法到 <code><em>O</em>(<i>rowIndex</i>)</code> 空间复杂度吗?</p>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"三角形最小路径和"
],
"children": [],
"export": [
"solution.json"
],
"title": "三角形最小路径和"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "28bc24c5a30443bd87c8a04a4c04eb7b"
}
\ No newline at end of file
# 三角形最小路径和
以下错误的选项是?
<p>给定一个三角形 <code>triangle</code> ,找出自顶向下的最小路径和。</p>
<p>每一步只能移动到下一行中相邻的结点上。<strong>相邻的结点 </strong>在这里指的是 <strong>下标</strong><strong>上一层结点下标</strong> 相同或者等于 <strong>上一层结点下标 + 1</strong> 的两个结点。也就是说,如果正位于当前行的下标 <code>i</code> ,那么下一步可以移动到下一行的下标 <code>i</code><code>i + 1</code></p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong>triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]
<strong>输出:</strong>11
<strong>解释:</strong>如下面简图所示:
<strong>2</strong>
<strong>3</strong> 4
6 <strong>5</strong> 7
4 <strong>1</strong> 8 3
自顶向下的最小路径和为 11(即,2 + 3 + 5 + 1 = 11)。
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>triangle = [[-10]]
<strong>输出:</strong>-10
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= triangle.length <= 200</code></li>
<li><code>triangle[0].length == 1</code></li>
<li><code>triangle[i].length == triangle[i - 1].length + 1</code></li>
<li><code>-10<sup>4</sup> <= triangle[i][j] <= 10<sup>4</sup></code></li>
</ul>
<p> </p>
<p><strong>进阶:</strong></p>
<ul>
<li>你可以只使用 <code>O(n)</code> 的额外空间(<code>n</code> 为三角形的总行数)来解决这个问题吗?</li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
......@@ -2,5 +2,5 @@
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "d20ae4f7cab4433c85c3866f08c219d9"
"exercise_id": "b1e54524655143059dc927e4641d44af"
}
\ No newline at end of file
......@@ -68,76 +68,7 @@ M 1000</pre>
<li><code>1 &lt;= num &lt;= 3999</code></li>
</ul>
</div>
<p><div class="notranslate">
<p>罗马数字包含以下七种字符:&nbsp;<code>I</code>&nbsp;<code>V</code>&nbsp;<code>X</code>&nbsp;<code>L</code><code>C</code><code>D</code>&nbsp;&nbsp;<code>M</code>
</p>
<pre><strong>字符</strong> <strong>数值</strong>
I 1
V 5
X 10
L 50
C 100
D 500
M 1000</pre>
<p>例如, 罗马数字 2 写做&nbsp;<code>II</code>&nbsp;,即为两个并列的 1。12
写做&nbsp;<code>XII</code>&nbsp;,即为&nbsp;<code>X</code>&nbsp;+&nbsp;<code>II</code>&nbsp;。 27
写做&nbsp;&nbsp;<code>XXVII</code>,
即为&nbsp;<code>XX</code>&nbsp;+&nbsp;<code>V</code>&nbsp;+&nbsp;<code>II</code>&nbsp;。</p>
<p>通常情况下,罗马数字中小的数字在大的数字的右边。但也存在特例,例如 4 不写做&nbsp;<code>IIII</code>,而是&nbsp;<code>IV</code>。数字 1 在数字 5 的左边,所表示的数等于大数 5
减小数 1 得到的数值 4 。同样地,数字 9 表示为&nbsp;<code>IX</code>。这个特殊的规则只适用于以下六种情况:</p>
<ul>
<li><code>I</code>&nbsp;可以放在&nbsp;<code>V</code>&nbsp;(5) 和&nbsp;<code>X</code>&nbsp;(10) 的左边,来表示 4 和 9。</li>
<li><code>X</code>&nbsp;可以放在&nbsp;<code>L</code>&nbsp;(50) 和&nbsp;<code>C</code>&nbsp;(100) 的左边,来表示 40
和&nbsp;90。&nbsp;</li>
<li><code>C</code>&nbsp;可以放在&nbsp;<code>D</code>&nbsp;(500) 和&nbsp;<code>M</code>&nbsp;(1000) 的左边,来表示&nbsp;400
和&nbsp;900。</li>
</ul>
<p>给你一个整数,将其转为罗马数字。</p>
<p>&nbsp;</p>
<p><strong>示例&nbsp;1:</strong></p>
<pre><strong>输入:</strong>&nbsp;num = 3
<strong><br />输出:</strong> "III"</pre>
<p><strong>示例&nbsp;2:</strong></p>
<pre><strong>输入:</strong>&nbsp;num = 4
<strong><br />输出:</strong> "IV"</pre>
<p><strong>示例&nbsp;3:</strong></p>
<pre><strong>输入:</strong>&nbsp;num = 9
<strong><br />输出:</strong> "IX"</pre>
<p><strong>示例&nbsp;4:</strong></p>
<pre><strong>输入:</strong>&nbsp;num = 58
<strong><br />输出:</strong> "LVIII"
<strong><br />解释:</strong> L = 50, V = 5, III = 3.
</pre>
<p><strong>示例&nbsp;5:</strong></p>
<pre><strong>输入:</strong>&nbsp;num = 1994
<strong><br />输出:</strong> "MCMXCIV"
<strong><br />解释:</strong> M = 1000, CM = 900, XC = 90, IV = 4.</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= num &lt;= 3999</code></li>
</ul>
</div>
<p>以下错误的选项是?</p></p>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"买卖股票的最佳时机"
],
"children": [],
"export": [
"solution.json"
],
"title": "买卖股票的最佳时机"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "ae9df054283842929a6fdb70445410c8"
}
\ No newline at end of file
# 买卖股票的最佳时机
以下错误的选项是?
<p>给定一个数组 <code>prices</code> ,它的第 <code>i</code> 个元素 <code>prices[i]</code> 表示一支给定股票第 <code>i</code> 天的价格。</p>
<p>你只能选择 <strong>某一天</strong> 买入这只股票,并选择在 <strong>未来的某一个不同的日子</strong> 卖出该股票。设计一个算法来计算你所能获取的最大利润。</p>
<p>返回你可以从这笔交易中获取的最大利润。如果你不能获取任何利润,返回 <code>0</code></p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong>[7,1,5,3,6,4]
<strong>输出:</strong>5
<strong>解释:</strong>在第 2 天(股票价格 = 1)的时候买入,在第 5 天(股票价格 = 6)的时候卖出,最大利润 = 6-1 = 5 。
注意利润不能是 7-1 = 6, 因为卖出价格需要大于买入价格;同时,你不能在买入前卖出股票。
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>prices = [7,6,4,3,1]
<strong>输出:</strong>0
<strong>解释:</strong>在这种情况下, 没有交易完成, 所以最大利润为 0。
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= prices.length <= 10<sup>5</sup></code></li>
<li><code>0 <= prices[i] <= 10<sup>4</sup></code></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"买卖股票的最佳时机 II"
],
"children": [],
"export": [
"solution.json"
],
"title": "买卖股票的最佳时机 II"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "bb231155c0f74d2487e0e94741090a6b"
}
\ No newline at end of file
# 买卖股票的最佳时机 II
以下错误的选项是?
<p>给定一个数组 <code>prices</code> ,其中 <code>prices[i]</code> 是一支给定股票第 <code>i</code> 天的价格。</p>
<p>设计一个算法来计算你所能获取的最大利润。你可以尽可能地完成更多的交易(多次买卖一支股票)。</p>
<p><strong>注意:</strong>你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong> prices = [7,1,5,3,6,4]
<strong>输出:</strong> 7
<strong>解释:</strong> 在第 2 天(股票价格 = 1)的时候买入,在第 3 天(股票价格 = 5)的时候卖出, 这笔交易所能获得利润 = 5-1 = 4 。
  随后,在第 4 天(股票价格 = 3)的时候买入,在第 5 天(股票价格 = 6)的时候卖出, 这笔交易所能获得利润 = 6-3 = 3 。
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong> prices = [1,2,3,4,5]
<strong>输出:</strong> 4
<strong>解释:</strong> 在第 1 天(股票价格 = 1)的时候买入,在第 5 天 (股票价格 = 5)的时候卖出, 这笔交易所能获得利润 = 5-1 = 4 。
  注意你不能在第 1 天和第 2 天接连购买股票,之后再将它们卖出。因为这样属于同时参与了多笔交易,你必须在再次购买前出售掉之前的股票。
</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong> prices = [7,6,4,3,1]
<strong>输出:</strong> 0
<strong>解释:</strong> 在这种情况下, 没有交易完成, 所以最大利润为 0。</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= prices.length <= 3 * 10<sup>4</sup></code></li>
<li><code>0 <= prices[i] <= 10<sup>4</sup></code></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"买卖股票的最佳时机 III"
],
"children": [],
"export": [
"solution.json"
],
"title": "买卖股票的最佳时机 III"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "49d44a4e374941a2842fbb34f9cf0501"
}
\ No newline at end of file
# 买卖股票的最佳时机 III
以下错误的选项是?
<p>给定一个数组,它的第<em> </em><code>i</code> 个元素是一支给定的股票在第 <code>i</code><em> </em>天的价格。</p>
<p>设计一个算法来计算你所能获取的最大利润。你最多可以完成 <strong>两笔 </strong>交易。</p>
<p><strong>注意:</strong>你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong>prices = [3,3,5,0,0,3,1,4]
<strong>输出:</strong>6
<strong>解释:</strong>在第 4 天(股票价格 = 0)的时候买入,在第 6 天(股票价格 = 3)的时候卖出,这笔交易所能获得利润 = 3-0 = 3 。
  随后,在第 7 天(股票价格 = 1)的时候买入,在第 8 天 (股票价格 = 4)的时候卖出,这笔交易所能获得利润 = 4-1 = 3 。</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>prices = [1,2,3,4,5]
<strong>输出:</strong>4
<strong>解释:</strong>在第 1 天(股票价格 = 1)的时候买入,在第 5 天 (股票价格 = 5)的时候卖出, 这笔交易所能获得利润 = 5-1 = 4 。  
  注意你不能在第 1 天和第 2 天接连购买股票,之后再将它们卖出。  
  因为这样属于同时参与了多笔交易,你必须在再次购买前出售掉之前的股票。
</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong>prices = [7,6,4,3,1]
<strong>输出:</strong>0
<strong>解释:</strong>在这个情况下, 没有交易完成, 所以最大利润为 0。</pre>
<p><strong>示例 4:</strong></p>
<pre>
<strong>输入:</strong>prices = [1]
<strong>输出:</strong>0
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <prices.length <= 10<sup>5</sup></code></li>
<li><code>0 <prices[i] <= 10<sup>5</sup></code></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"二叉树中的最大路径和"
],
"children": [],
"export": [
"solution.json"
],
"title": "二叉树中的最大路径和"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "b26b38cc4631496080fc88639e010df3"
}
\ No newline at end of file
# 二叉树中的最大路径和
以下错误的选项是?
<p><strong>路径</strong> 被定义为一条从树中任意节点出发,沿父节点-子节点连接,达到任意节点的序列。同一个节点在一条路径序列中 <strong>至多出现一次</strong> 。该路径<strong> 至少包含一个 </strong>节点,且不一定经过根节点。</p>
<p><strong>路径和</strong> 是路径中各节点值的总和。</p>
<p>给你一个二叉树的根节点 <code>root</code> ,返回其 <strong>最大路径和</strong></p>
<p> </p>
<p><strong>示例 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/13/exx1.jpg" style="width: 322px; height: 182px;" />
<pre>
<strong>输入:</strong>root = [1,2,3]
<strong>输出:</strong>6
<strong>解释:</strong>最优路径是 2 -> 1 -> 3 ,路径和为 2 + 1 + 3 = 6</pre>
<p><strong>示例 2:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/13/exx2.jpg" />
<pre>
<strong>输入:</strong>root = [-10,9,20,null,null,15,7]
<strong>输出:</strong>42
<strong>解释:</strong>最优路径是 15 -> 20 -> 7 ,路径和为 15 + 20 + 7 = 42
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点数目范围是 <code>[1, 3 * 10<sup>4</sup>]</code></li>
<li><code>-1000 <= Node.val <= 1000</code></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"验证回文串"
],
"children": [],
"export": [
"solution.json"
],
"title": "验证回文串"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "aff0a62b52a3433f9aec60f3acc0ce97"
}
\ No newline at end of file
# 验证回文串
以下错误的选项是?
<p>给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写。</p>
<p><strong>说明:</strong>本题中,我们将空字符串定义为有效的回文串。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong> "A man, a plan, a canal: Panama"
<strong>输出:</strong> true
<strong>解释:</strong>"amanaplanacanalpanama" 是回文串
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong> "race a car"
<strong>输出:</strong> false
<strong>解释:</strong>"raceacar" 不是回文串
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= s.length <= 2 * 10<sup>5</sup></code></li>
<li>字符串 <code>s</code> 由 ASCII 字符组成</li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"单词接龙 II"
],
"children": [],
"export": [
"solution.json"
],
"title": "单词接龙 II"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "84292d0d29094d59bd5be678c4c853e4"
}
\ No newline at end of file
# 单词接龙 II
以下错误的选项是?
<p>按字典 <code>wordList</code> 完成从单词 <code>beginWord</code> 到单词 <code>endWord</code> 转化,一个表示此过程的 <strong>转换序列</strong> 是形式上像 <code>beginWord -> s<sub>1</sub> -> s<sub>2</sub> -> ... -> s<sub>k</sub></code> 这样的单词序列,并满足:</p>
<div class="original__bRMd">
<div>
<ul>
<li>每对相邻的单词之间仅有单个字母不同。</li>
<li>转换过程中的每个单词 <code>s<sub>i</sub></code><code>1 <= i <= k</code>)必须是字典 <code>wordList</code> 中的单词。注意,<code>beginWord</code> 不必是字典 <code>wordList</code> 中的单词。</li>
<li><code>s<sub>k</sub> == endWord</code></li>
</ul>
<p>给你两个单词 <code>beginWord</code><code>endWord</code> ,以及一个字典 <code>wordList</code> 。请你找出并返回所有从 <code>beginWord</code><code>endWord</code><strong>最短转换序列</strong> ,如果不存在这样的转换序列,返回一个空列表。每个序列都应该以单词列表<em> </em><code>[beginWord, s<sub>1</sub>, s<sub>2</sub>, ..., s<sub>k</sub>]</code> 的形式返回。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong>beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]
<strong>输出:</strong>[["hit","hot","dot","dog","cog"],["hit","hot","lot","log","cog"]]
<strong>解释:</strong>存在 2 种最短的转换序列:
"hit" -> "hot" -> "dot" -> "dog" -> "cog"
"hit" -> "hot" -> "lot" -> "log" -> "cog"
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
<strong>输出:</strong>[]
<strong>解释:</strong>endWord "cog" 不在字典 wordList 中,所以不存在符合要求的转换序列。
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= beginWord.length <= 7</code></li>
<li><code>endWord.length == beginWord.length</code></li>
<li><code>1 <= wordList.length <= 5000</code></li>
<li><code>wordList[i].length == beginWord.length</code></li>
<li><code>beginWord</code><code>endWord</code><code>wordList[i]</code> 由小写英文字母组成</li>
<li><code>beginWord != endWord</code></li>
<li><code>wordList</code> 中的所有单词 <strong>互不相同</strong></li>
</ul>
</div>
</div>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"单词接龙"
],
"children": [],
"export": [
"solution.json"
],
"title": "单词接龙"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "3cee91c0e09040b7b0c46b7f5ebb7cc5"
}
\ No newline at end of file
# 单词接龙
以下错误的选项是?
<p>字典 <code>wordList</code> 中从单词 <code>beginWord</code><em> </em><code>endWord</code><strong>转换序列 </strong>是一个按下述规格形成的序列:</p>
<ul>
<li>序列中第一个单词是 <code>beginWord</code></li>
<li>序列中最后一个单词是 <code>endWord</code></li>
<li>每次转换只能改变一个字母。</li>
<li>转换过程中的中间单词必须是字典 <code>wordList</code> 中的单词。</li>
</ul>
<p>给你两个单词<em> </em><code>beginWord</code><em> </em><code>endWord</code> 和一个字典 <code>wordList</code> ,找到从 <code>beginWord</code> 到 <code>endWord</code><strong>最短转换序列</strong> 中的 <strong>单词数目</strong> 。如果不存在这样的转换序列,返回 0。</p>
 
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong>beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]
<strong>输出:</strong>5
<strong>解释:</strong>一个最短转换序列是 "hit" -> "hot" -> "dot" -> "dog" -> "cog", 返回它的长度 5。
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
<strong>输出:</strong>0
<strong>解释:</strong>endWord "cog" 不在字典中,所以无法进行转换。</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= beginWord.length <= 10</code></li>
<li><code>endWord.length == beginWord.length</code></li>
<li><code>1 <= wordList.length <= 5000</code></li>
<li><code>wordList[i].length == beginWord.length</code></li>
<li><code>beginWord</code><code>endWord</code><code>wordList[i]</code> 由小写英文字母组成</li>
<li><code>beginWord != endWord</code></li>
<li><code>wordList</code> 中的所有字符串 <strong>互不相同</strong></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"最长连续序列"
],
"children": [],
"export": [
"solution.json"
],
"title": "最长连续序列"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "dce3e3515a4b405e8aec92b075fac20f"
}
\ No newline at end of file
# 最长连续序列
以下错误的选项是?
<p>给定一个未排序的整数数组 <code>nums</code> ,找出数字连续的最长序列(不要求序列元素在原数组中连续)的长度。</p>
<p>请你设计并实现时间复杂度为 <code>O(n)</code><em> </em>的算法解决此问题。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong>nums = [100,4,200,1,3,2]
<strong>输出:</strong>4
<strong>解释:</strong>最长数字连续序列是 <code>[1, 2, 3, 4]。它的长度为 4。</code></pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>nums = [0,3,7,2,5,8,4,6,0,1]
<strong>输出:</strong>9
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 <= nums.length <= 10<sup>5</sup></code></li>
<li><code>-10<sup>9</sup> <= nums[i] <= 10<sup>9</sup></code></li>
</ul>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"求根节点到叶节点数字之和"
],
"children": [],
"export": [
"solution.json"
],
"title": "求根节点到叶节点数字之和"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "c2029480bab042f781f764f5c549966d"
}
\ No newline at end of file
# 求根节点到叶节点数字之和
以下错误的选项是?
给你一个二叉树的根节点 <code>root</code> ,树中每个节点都存放有一个 <code>0</code><code>9</code> 之间的数字。
<div class="original__bRMd">
<div>
<p>每条从根节点到叶节点的路径都代表一个数字:</p>
<ul>
<li>例如,从根节点到叶节点的路径 <code>1 -> 2 -> 3</code> 表示数字 <code>123</code></li>
</ul>
<p>计算从根节点到叶节点生成的 <strong>所有数字之和</strong></p>
<p><strong>叶节点</strong> 是指没有子节点的节点。</p>
<p> </p>
<p><strong>示例 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/02/19/num1tree.jpg" style="width: 212px; height: 182px;" />
<pre>
<strong>输入:</strong>root = [1,2,3]
<strong>输出:</strong>25
<strong>解释:</strong>
从根到叶子节点路径 <code>1->2</code> 代表数字 <code>12</code>
从根到叶子节点路径 <code>1->3</code> 代表数字 <code>13</code>
因此,数字总和 = 12 + 13 = <code>25</code></pre>
<p><strong>示例 2:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/02/19/num2tree.jpg" style="width: 292px; height: 302px;" />
<pre>
<strong>输入:</strong>root = [4,9,0,5,1]
<strong>输出:</strong>1026
<strong>解释:</strong>
从根到叶子节点路径 <code>4->9->5</code> 代表数字 495
从根到叶子节点路径 <code>4->9->1</code> 代表数字 491
从根到叶子节点路径 <code>4->0</code> 代表数字 40
因此,数字总和 = 495 + 491 + 40 = <code>1026</code>
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>树中节点的数目在范围 <code>[1, 1000]</code></li>
<li><code>0 <= Node.val <= 9</code></li>
<li>树的深度不超过 <code>10</code></li>
</ul>
</div>
</div>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"被围绕的区域"
],
"children": [],
"export": [
"solution.json"
],
"title": "被围绕的区域"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "a2608cf9adcf469d86ac1874392f6288"
}
\ No newline at end of file
# 被围绕的区域
以下错误的选项是?
给你一个 <code>m x n</code> 的矩阵 <code>board</code> ,由若干字符 <code>'X'</code><code>'O'</code> ,找到所有被 <code>'X'</code> 围绕的区域,并将这些区域里所有的 <code>'O'</code><code>'X'</code> 填充。
<div class="original__bRMd">
<div>
<p> </p>
<p><strong>示例 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2021/02/19/xogrid.jpg" style="width: 550px; height: 237px;" />
<pre>
<strong>输入:</strong>board = [["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]
<strong>输出:</strong>[["X","X","X","X"],["X","X","X","X"],["X","X","X","X"],["X","O","X","X"]]
<strong>解释:</strong>被围绕的区间不会存在于边界上,换句话说,任何边界上的 <code>'O'</code> 都不会被填充为 <code>'X'</code>。 任何不在边界上,或不与边界上的 <code>'O'</code> 相连的 <code>'O'</code> 最终都会被填充为 <code>'X'</code>。如果两个元素在水平或垂直方向相邻,则称它们是“相连”的。
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>board = [["X"]]
<strong>输出:</strong>[["X"]]
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>m == board.length</code></li>
<li><code>n == board[i].length</code></li>
<li><code>1 <= m, n <= 200</code></li>
<li><code>board[i][j]</code><code>'X'</code><code>'O'</code></li>
</ul>
</div>
</div>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
......@@ -2,5 +2,5 @@
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "e323b8bfb3e64ec0b7b9e81e9bc57067"
"exercise_id": "0ef7da523b6b4d0187ea4f075f4445d3"
}
\ No newline at end of file
......@@ -68,76 +68,7 @@ M 1000</pre>
<li><code>1 &lt;= num &lt;= 3999</code></li>
</ul>
</div>
<p><div class="notranslate">
<p>罗马数字包含以下七种字符:&nbsp;<code>I</code>&nbsp;<code>V</code>&nbsp;<code>X</code>&nbsp;<code>L</code><code>C</code><code>D</code>&nbsp;&nbsp;<code>M</code>
</p>
<pre><strong>字符</strong> <strong>数值</strong>
I 1
V 5
X 10
L 50
C 100
D 500
M 1000</pre>
<p>例如, 罗马数字 2 写做&nbsp;<code>II</code>&nbsp;,即为两个并列的 1。12
写做&nbsp;<code>XII</code>&nbsp;,即为&nbsp;<code>X</code>&nbsp;+&nbsp;<code>II</code>&nbsp;。 27
写做&nbsp;&nbsp;<code>XXVII</code>,
即为&nbsp;<code>XX</code>&nbsp;+&nbsp;<code>V</code>&nbsp;+&nbsp;<code>II</code>&nbsp;。</p>
<p>通常情况下,罗马数字中小的数字在大的数字的右边。但也存在特例,例如 4 不写做&nbsp;<code>IIII</code>,而是&nbsp;<code>IV</code>。数字 1 在数字 5 的左边,所表示的数等于大数 5
减小数 1 得到的数值 4 。同样地,数字 9 表示为&nbsp;<code>IX</code>。这个特殊的规则只适用于以下六种情况:</p>
<ul>
<li><code>I</code>&nbsp;可以放在&nbsp;<code>V</code>&nbsp;(5) 和&nbsp;<code>X</code>&nbsp;(10) 的左边,来表示 4 和 9。</li>
<li><code>X</code>&nbsp;可以放在&nbsp;<code>L</code>&nbsp;(50) 和&nbsp;<code>C</code>&nbsp;(100) 的左边,来表示 40
和&nbsp;90。&nbsp;</li>
<li><code>C</code>&nbsp;可以放在&nbsp;<code>D</code>&nbsp;(500) 和&nbsp;<code>M</code>&nbsp;(1000) 的左边,来表示&nbsp;400
和&nbsp;900。</li>
</ul>
<p>给你一个整数,将其转为罗马数字。</p>
<p>&nbsp;</p>
<p><strong>示例&nbsp;1:</strong></p>
<pre><strong>输入:</strong>&nbsp;num = 3
<strong><br />输出:</strong> "III"</pre>
<p><strong>示例&nbsp;2:</strong></p>
<pre><strong>输入:</strong>&nbsp;num = 4
<strong><br />输出:</strong> "IV"</pre>
<p><strong>示例&nbsp;3:</strong></p>
<pre><strong>输入:</strong>&nbsp;num = 9
<strong><br />输出:</strong> "IX"</pre>
<p><strong>示例&nbsp;4:</strong></p>
<pre><strong>输入:</strong>&nbsp;num = 58
<strong><br />输出:</strong> "LVIII"
<strong><br />解释:</strong> L = 50, V = 5, III = 3.
</pre>
<p><strong>示例&nbsp;5:</strong></p>
<pre><strong>输入:</strong>&nbsp;num = 1994
<strong><br />输出:</strong> "MCMXCIV"
<strong><br />解释:</strong> M = 1000, CM = 900, XC = 90, IV = 4.</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= num &lt;= 3999</code></li>
</ul>
</div>
<p>以下错误的选项是?</p></p>
<p>以下错误的选项是?</p>
## aop
### before
```cpp
......
{
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [],
"children": [],
"export": []
"node_id": "569d5e11c4fc5de7844053d9a733c5e8",
"keywords": [
"leetcode",
"分割回文串"
],
"children": [],
"export": [
"solution.json"
],
"title": "分割回文串"
}
\ No newline at end of file
{
"type": "code_options",
"author": "CSDN.net",
"source": "solution.md",
"exercise_id": "9f4a10bcd13846a096f8fd2ad3b55b5f"
}
\ No newline at end of file
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部