52. Remove the Nth Node From the End
MediumLinked lists
Remove the nth node from the end of the list in one pass and return the head.
A linked list is passed as ListNode objects with val and next. The tests write lists as arrays.
Example 1
Input: head = [1, 2, 3, 4, 5], n = 2 Output: [1, 2, 3, 5]
Constraints
1 ≤ n ≤ number of nodes ≤ 30