...

/

Challenge: Remove Element from Generic Linked List

Challenge: Remove Element from Generic Linked List

Test your knowledge by solving this coding challenge.

Problem statement

The input consists of a generic linked list and an element to remove if it’s inside the list.

For the following input:

[1, 2, 3, 4, 5]
3

The output should be:

[1, 2, 4, 5]

For the following input:

["Hello", "World"]
"Hello"

The output should be:

["World"]

You should perform the removal in place by changing the pointers without constructing another list.

An element may appear multiple times in the list, in no particular order.

Challenge

Complete the functions in the following code widget using local references. The definition of the list structure is present in the background.

Note: We stress again that It’s crucial to make a memory drawing to be able to solve problems ...