0203. Remove Linked List Elements

https://leetcode.com/problems/remove-linked-list-elements

Description

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

ac

Last updated

Was this helpful?