Skip to content

Commit 32f49b1

Browse files
committed
#19: description update
1 parent 8280a1d commit 32f49b1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

c-sharp/Problems/linked-list/RemoveNthNodeFromEndOfList.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,28 @@
44
**
55
* Given the head of a linked list, remove the nth node from the end of the list and return its head.
66
*
7+
* Example 1:
8+
* Input: head = [1,2,3,4,5], n = 2
9+
* Output: [1,2,3,5]
10+
*
11+
* Example 2:
12+
* Input: head = [1], n = 1
13+
* Output: []
14+
*
15+
* Example 3:
16+
* Input: head = [1,2], n = 1
17+
* Output: [1]
18+
*
19+
* Constraints:
20+
* • The number of nodes in the list is sz.
21+
* • 1 <= sz <= 30
22+
* • 0 <= Node.val <= 100
23+
* • 1 <= n <= sz
24+
*
725
* Follow up: Could you do this in one pass?
26+
*
27+
* Hint 1:
28+
* Maintain two pointers and update one with a delay of n steps.
829
**
930
* https://leetcode.com/problems/remove-nth-node-from-end-of-list/
1031
***/

0 commit comments

Comments
 (0)