head and a number target. Remove every node whose value equals target; the other nodes keep their order.
Return the head of the resulting list. It may change if the first nodes are removed, and if everything is removed, return an empty list.head=list_node([3, 8, 3, 1, 3]), target=3 → [8, 1]
All three nodes holding 3 are cut out, including the first and the last; 8 and 1 remain.
head=list_node([5, 5]), target=5 → None
Every node goes, leaving an empty list.
head=list_node([2, 4, 6]), target=9 → [2, 4, 6]
No node holds 9, so the list stays the same.
target ≤ 50head=list_node([3, 8, 3, 1, 3]), target=3
[8, 1]
Run checks the first 3 tests in your browser. Submit checks all 114 tests on the server, hidden ones included.