Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aadae38

Browse files
committed
Added README.md file for Middle of the Linked List
1 parent 35350f8 commit aadae38

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

‎908-middle-of-the-linked-list/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<h2><a href="https://leetcode.com/problems/middle-of-the-linked-list">Middle of the Linked List</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Given the <code>head</code> of a singly linked list, return <em>the middle node of the linked list</em>.</p>
2+
3+
<p>If there are two middle nodes, return <strong>the second middle</strong> node.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
<img alt="" src="https://assets.leetcode.com/uploads/2021/07/23/lc-midlist1.jpg" style="width: 544px; height: 65px;" />
8+
<pre>
9+
<strong>Input:</strong> head = [1,2,3,4,5]
10+
<strong>Output:</strong> [3,4,5]
11+
<strong>Explanation:</strong> The middle node of the list is node 3.
12+
</pre>
13+
14+
<p><strong class="example">Example 2:</strong></p>
15+
<img alt="" src="https://assets.leetcode.com/uploads/2021/07/23/lc-midlist2.jpg" style="width: 664px; height: 65px;" />
16+
<pre>
17+
<strong>Input:</strong> head = [1,2,3,4,5,6]
18+
<strong>Output:</strong> [4,5,6]
19+
<strong>Explanation:</strong> Since the list has two middle nodes with values 3 and 4, we return the second one.
20+
</pre>
21+
22+
<p>&nbsp;</p>
23+
<p><strong>Constraints:</strong></p>
24+
25+
<ul>
26+
<li>The number of nodes in the list is in the range <code>[1, 100]</code>.</li>
27+
<li><code>1 &lt;= Node.val &lt;= 100</code></li>
28+
</ul>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /