MCPcopy Create free account
hub / github.com/VanjaRo/LeetCode / removeNthFromEnd

Function removeNthFromEnd

tasks/19.go:12–18  ·  view source on GitHub ↗
(head *ListNode, n int)

Source from the content-addressed store, hash-verified

10}
11
12func removeNthFromEnd(head *ListNode, n int) *ListNode {
13 ret := recursiveBackCounterDelete(head, n)
14 if ret == -1 {
15 return head.Next
16 }
17 return head
18}
19
20// 0 – found
21// -1 – delete next

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected