#3217

Delete Nodes From Linked List Present in Array

medium · premium · 69.5% accepted · 1,083 likes · top 77%

array · hash table · linked list

⊣ practice⊣ open on leetcode ↗

Description

You are given an array of integers nums and the head of a linked list. Return the head of the modified linked list after removing all nodes from the linked list that have a value that exists in nums.

Solution