Problem:
Remove the nth node from the end of a singly linked list in one traversal.
β In this video, we cover:
Brute Force (2-pass) β Get the length and delete
Optimal (1-pass) β Use two pointers with a gap of n nodes
π Problem:
https://leetcode.com/problems/remove-nth-node-from-end-of-list/
π Submission:
https://leetcode.com/problems/remove-nth-node-from-end-of-list/submissions/1620882627/
π Timestamps:
00:00 β Introduction
00:35 β Problem Explanation
00:55 β Brute Force (Two-Pass)
01:45 β Optimal One-Pass Two Pointer Approach
08:00 β Code Walkthrough + Edge Cases
#Blind75 #Leetcode #Python #BinaryTree #Recursion #DSA #CodingInterview
Download
0 formats
No download links available.
π§ Remove Nth Node From End of List β Blind 75 | Python | One-Pass Two-Pointer Solution | NatokHD