https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/?envType=study-plan-v2&envId=top-interview-150

def removeNthFromEnd(self, head: Optional[ListNode], n: int) -> Optional[ListNode]:
  if not head: return head
  dummy_head = ListNode(-1)
  dummy_head.next = head
  
  slow, fast = dummy_head, dummy_head
  for i in range(n+1):
      fast = fast.next

  while fast:
      fast = fast.next
      slow = slow.next

  slow.next = slow.next.next

  return dummy_head.next