Remove Dups
Write code to remove duplicates from an unsorted linked list.
Follow Up: How would you solve this if a temporary buffer is not allowed?
Example:
Input: 1 → 2 → 3 → 2 → 1
Output: 1 → 2 → 3
Note: For this problem, represent the linked list as a Python list for simplicity and return the deduplicated list.
Hints
solution.py
Python ready
Test Output
▶
Click "Run Tests" to execute your code