Skip to content

Commit c9ff560

Browse files
committed
Create README - LeetHub
1 parent 29814f6 commit c9ff560

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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>&nbsp;</p>
4+
<p><strong>Example 1:</strong></p>
5+
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/03/remove_ex1.jpg" style="width: 542px; height: 222px;">
6+
<pre><strong>Input:</strong> head = [1,2,3,4,5], n = 2
7+
<strong>Output:</strong> [1,2,3,5]
8+
</pre>
9+
10+
<p><strong>Example 2:</strong></p>
11+
12+
<pre><strong>Input:</strong> head = [1], n = 1
13+
<strong>Output:</strong> []
14+
</pre>
15+
16+
<p><strong>Example 3:</strong></p>
17+
18+
<pre><strong>Input:</strong> head = [1,2], n = 1
19+
<strong>Output:</strong> [1]
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 <code>sz</code>.</li>
27+
<li><code>1 &lt;= sz &lt;= 30</code></li>
28+
<li><code>0 &lt;= Node.val &lt;= 100</code></li>
29+
<li><code>1 &lt;= n &lt;= sz</code></li>
30+
</ul>
31+
32+
<p>&nbsp;</p>
33+
<p><strong>Follow up:</strong> Could you do this in one pass?</p>
34+
</div>

0 commit comments

Comments
 (0)