Goldman Sachs Interview Question

In a linked list, find nth element from the end

Interview Answer

Anonymous

Jul 11, 2019

Use 2 pointers. Advance pointer p1 by n. Advance both pointers until p1 reaches the end/null. Return p2