Linked Lists
59 / 170Linked ListsLesson 4 of 12About 37 min
Counting from the end without knowing the length: start one pointer early and keep the distance.
This is meant to insert a new node immediately before the kth node from the end. On a three-node list with k equal to 1 the new node lands in the wrong place. Click the line that causes it.
Read the constraints first and let them tell you what complexity is expected. Derive the approach, implement it, run the tests, and submit when it passes.