arrow_back Back to Challenges

#19 Remove Nth Node From End of List

Medium Acceptance 0%
description

Problem Description

Given the `head` of a linked list, remove the `n`th node from the end of the list and return its head.

checklist Constraints

The number of nodes in the list is sz.
1 <= sz <= 30
0 <= Node.val <= 100
1 <= n <= sz

science Examples

Case #1

In: head = [1,2,3,4,5] n = 2
Out: [1,2,3,5]

Case #2

In: head = [1] n = 1
Out: []

Mastery Tags

Linked List Two Pointers

Hiring Companies

Amazon Meta Microsoft
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude