Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Create a copy of the given linked list, iterate over the copy, and modify each of its nodes according to the given function. Return the modified copy of the list. The original list must remain unmodified.
P.S. You can't create a copy of a linked list by simply creating a new variable.
Example in JavaScript:
const newHead = head; // This won't work! It doesn't create a copy. It creates a reference to the same list.
You must build a new list, node by node.