--
程式码
应该不会算无意义文字吧
虽然我觉得我的程式码真的很没有意义==
def modifiedList(self, nums: List[int], head: Optional[ListNode]) ->
Optional[ListNode]:
nums = set(n for n in nums)
dummy = ListNode(0, next=head)
pre = dummy
cur = head
while cur:
if cur.val in nums:
pre.next = cur.next
cur = cur.next
else:
pre = cur
cur = cur.next
return dummy.next