Skip to content

Commit 8406542

Browse files
committed
Create README - LeetHub
1 parent 489cf64 commit 8406542

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<h2>19. Remove Nth Node From End of List</h2><h3>Medium</h3><hr><div><p>Given the <code>head</code> of a linked list, remove the <code>n<sup>th</sup></code> node from the end of the list and return its head.</p>
2+
3+
<p><strong>Follow up:</strong>&nbsp;Could you do this in one pass?</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong>Example 1:</strong></p>
7+
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/03/remove_ex1.jpg" style="width: 542px; height: 222px;">
8+
<pre><strong>Input:</strong> head = [1,2,3,4,5], n = 2
9+
<strong>Output:</strong> [1,2,3,5]
10+
</pre>
11+
12+
<p><strong>Example 2:</strong></p>
13+
14+
<pre><strong>Input:</strong> head = [1], n = 1
15+
<strong>Output:</strong> []
16+
</pre>
17+
18+
<p><strong>Example 3:</strong></p>
19+
20+
<pre><strong>Input:</strong> head = [1,2], n = 1
21+
<strong>Output:</strong> [1]
22+
</pre>
23+
24+
<p>&nbsp;</p>
25+
<p><strong>Constraints:</strong></p>
26+
27+
<ul>
28+
<li>The number of nodes in the list is <code>sz</code>.</li>
29+
<li><code>1 &lt;= sz &lt;= 30</code></li>
30+
<li><code>0 &lt;= Node.val &lt;= 100</code></li>
31+
<li><code>1 &lt;= n &lt;= sz</code></li>
32+
</ul>
33+
</div>

0 commit comments

Comments
 (0)