Skip to content

Commit 64941b6

Browse files
committed
Create README - LeetHub
1 parent dfd298e commit 64941b6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

0143-reorder-list/README.md

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

0 commit comments

Comments
 (0)