You are given a singly linked list and a number val. Remove every node whose value is equal to val. Return the new list.
How the judge passes the data
Examples
Example 1:
Input: head = [4,1,4,2,4], val = 4
Output: [1,2]
Explanation: All three nodes with value 4 are removed.
Example 2:
Input: head = [5,6], val = 9
Output: [5,6]
Explanation: No node has the value 9, so the list does not change.
Example 3:
Input: head = [3,3,3], val = 3
Output: []
Explanation: Every node is removed, so the list becomes empty.