Unlink the k-th node from the back
Write remove_kth_from_end(head, k): remove the k-th node counting from the end of a singly linked list (k = 1 is the last node) and return the first node of the result, or None if nothing is left. The list has at least one node and 1 ≤ k ≤ its length. Each ListNode has val and next.
Aim for a single pass, without counting the nodes first, and unlink the node instead of building a new list.
The tests call the provided run_remove_kth_from_end(values, k), which builds the list from values and returns the values of the list you return.
Examples
run_remove_kth_from_end([1,2,3,4,5], 2)→[1,2,3,5]run_remove_kth_from_end([1], 1)→[]run_remove_kth_from_end([1,2], 1)→[1]