Shu-How Zの小窝

Loading...

237.删除链表中的节点

237.删除链表中的节点

/**
 * Definition for singly-linked list.
 * function ListNode(val) {
 *     this.val = val;
 *     this.next = null;
 * }
 */
/**
 * @param {ListNode} node
 * @return {void} Do not return anything, modify node in-place instead.
 */
var deleteNode = function(node) {
    node.val=node.next.val
    node.next=node.next.next
};
posted @ 2025-01-10 15:34  KooTeam  阅读(8)  评论(0)    收藏  举报