Pattern 22: LeetCode Interview Patterns24 sections · 736 units
Open in CourseQuiz: Finding Nth From End
Test your understanding
Check Your Understanding
To find the nth node from the end in one pass, what technique should you use?
- A.Reverse the list first
- B.Use recursion to count backwards
- C.Store all nodes in an array
- D.Use two pointers with an n-node gap between them