Skip to content

Commit 91254c9

Browse files
committed
Create README - LeetHub
1 parent feedb44 commit 91254c9

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

0143-reorder-list/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<h2><a href="https://leetcode.com/problems/reorder-list">143. Reorder List</a></h2><h3>Medium</h3><hr><p>You are given the head of a singly linked-list. The list can be represented as:</p>
2+
3+
<pre>
4+
L<sub>0</sub> &rarr; L<sub>1</sub> &rarr; &hellip; &rarr; L<sub>n - 1</sub> &rarr; L<sub>n</sub>
5+
</pre>
6+
7+
<p><em>Reorder the list to be on the following form:</em></p>
8+
9+
<pre>
10+
L<sub>0</sub> &rarr; L<sub>n</sub> &rarr; L<sub>1</sub> &rarr; L<sub>n - 1</sub> &rarr; L<sub>2</sub> &rarr; L<sub>n - 2</sub> &rarr; &hellip;
11+
</pre>
12+
13+
<p>You may not modify the values in the list&#39;s nodes. Only nodes themselves may be changed.</p>
14+
15+
<p>&nbsp;</p>
16+
<p><strong class="example">Example 1:</strong></p>
17+
<img alt="" src="https://assets.leetcode.com/uploads/2021/03/04/reorder1linked-list.jpg" style="width: 422px; height: 222px;" />
18+
<pre>
19+
<strong>Input:</strong> head = [1,2,3,4]
20+
<strong>Output:</strong> [1,4,2,3]
21+
</pre>
22+
23+
<p><strong class="example">Example 2:</strong></p>
24+
<img alt="" src="https://assets.leetcode.com/uploads/2021/03/09/reorder2-linked-list.jpg" style="width: 542px; height: 222px;" />
25+
<pre>
26+
<strong>Input:</strong> head = [1,2,3,4,5]
27+
<strong>Output:</strong> [1,5,2,4,3]
28+
</pre>
29+
30+
<p>&nbsp;</p>
31+
<p><strong>Constraints:</strong></p>
32+
33+
<ul>
34+
<li>The number of nodes in the list is in the range <code>[1, 5 * 10<sup>4</sup>]</code>.</li>
35+
<li><code>1 &lt;= Node.val &lt;= 1000</code></li>
36+
</ul>

0 commit comments

Comments
 (0)