1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part3

This commit is contained in:
2022-03-27 20:46:41 +08:00
parent 6dafca13c5
commit dfacb20d31
1385 changed files with 115239 additions and 3 deletions

View File

@@ -0,0 +1,31 @@
<p>给定一个头结点为 <code>head</code> 的非空单链表,返回链表的中间结点。</p>
<p>如果有两个中间结点,则返回第二个中间结点。</p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>[1,2,3,4,5]
<strong>输出:</strong>此列表中的结点 3 (序列化形式:[3,4,5])
返回的结点值为 3 。 (测评系统对该结点序列化表述是 [3,4,5])。
注意,我们返回了一个 ListNode 类型的对象 ans这样
ans.val = 3, ans.next.val = 4, ans.next.next.val = 5, 以及 ans.next.next.next = NULL.
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>[1,2,3,4,5,6]
<strong>输出:</strong>此列表中的结点 4 (序列化形式:[4,5,6])
由于该列表有两个中间结点,值分别为 3 和 4我们返回第二个结点。
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li>给定链表的结点数介于 <code>1</code> 和 <code>100</code> 之间。</li>
</ul>