摘要:
请编写一个函数,使其可以删除某个链表中给定的(非末尾)节点。传入函数的唯一参数为 要被删除的节点 。 class Solution: def deleteNode(self, node): """ :type node: ListNode :rtype: void Do not return any 阅读全文
摘要:
给你一个链表的头节点 head 和一个整数 val ,请你删除链表中所有满足 Node.val == val 的节点,并返回 新的头节点 。 class Solution: def removeElements(self, head: ListNode, val: int) -> ListNode: 阅读全文