Home
Log in
DescriptionSubmissionsSolution
DescriptionSubmissionsSolution
Loading...

Log in to run or submit

head =
n =

Codey

Practise coding problems, test your solutions and track your progress.

Explore

  • Problems
  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

© 2026 Codey. Personal learning project.

Solution
Updated: 2026-02-23

Idea

Use two pointers with a fixed gap of n nodes.

Approach

Advance fast by n. Then move fast and slow together until fast is at the last node. slow.next is the node to remove.

Why it works

The n-node gap guarantees slow lands right before the target node.

Code
Loading...
Complexity
Time: O(n)
Space: O(1)
Solution
Updated: 2026-02-23

Idea

Use two pointers with a fixed gap of n nodes.

Approach

Advance fast by n. Then move fast and slow together until fast is at the last node. slow.next is the node to remove.

Why it works

The n-node gap guarantees slow lands right before the target node.

Code
Loading...
Complexity
Time: O(n)
Space: O(1)