LeetCode 19 Remove Nth Node From End - Problem Statement

The problem

Given the head of a linked list, remove the nth node from the end and return the head.

With 1 → 2 → 3 → 4 → 5 and n = 2, the answer is 1 → 2 → 3 → 5. The 2nd node from the end is 4, so you remove it.

Can you do this in one pass without first counting the length?

Constraints: List length from 11 to 3030. 1n1 \le n \le list length.