694. Remove Linked List Elements
Given the head of a linked list and an integer value, remove all nodes from the linked list that have a value equal to the given value, and print the resulting linked list.
The first line contains two integers, N and k, representing the length of the linked list and the value to be removed, respectively. The second line contains N integers, representing the nodes of the linked list.
Print the resulting linked list.
5 6 1 6 4 6 7
1 4 7
The number of nodes in the linked list is between 0 and 10,000 inclusive. Each node's value is an integer between 1 and 50 inclusive.