0203. Remove Linked List Elements
Last updated
Last updated
https://leetcode.com/problems/remove-linked-list-elements
Given the head
of a linked list and an integer val
, remove all the nodes of the linked list that has Node.val == val
, and return the new head.
Example 1:
Example 2:
Example 3:
Constraints:
The number of nodes in the list is in the range [0, 104]
.
1 <= Node.val <= 50
0 <= val <= 50