bhardwaj-shubham12 / leetCode

LeetCode practice questions
0 stars 1 forks source link

19. Remove nth node from the end of the List #12

Open S-125 opened 1 month ago

S-125 commented 1 month ago

Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: Input: head = [1,2,3,4,5], n = 2 Output: [1,2,3,5] Example 2:

Input: head = [1], n = 1 Output: []

Example 3: Input: head = [1,2], n = 1 Output: [1]

Constraints:

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

S-125 commented 1 month ago

I want to add this program. Please assign me this under hacktoberfest 2024