删除第K个链接列表节点

Write a function that receives as input the head node of a linked list an integer k.

Your function should remove the kth node from the end of the linked list and return the head node of the updated list.

链接列表示例

(20)->(19)->(18)->(17)->(16)->(15)->(14)->(13)->(12)->(11)->空值

Head node would refer to the node (20). Let k = 4, so it should remove the 4th node of the list, node (14).

新列表中应删除节点(14)。

const linkedList = node => {

let head = node;


}

我不确定该怎么做。我定义了一个以节点为参数的函数,我需要能够区分每个节点,并能够遍历并删除有问题的节点。

有任何入门提示或指示吗?