203. Remove Linked List Elements

Description

Remove all elements from a linked list of integers that have value val.

Example
Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6
Return: 1 --> 2 --> 3 --> 4 --> 5

Solution

Basic

Two pointers



你可能感兴趣的:(203. Remove Linked List Elements)