Objective: Write a program to remove the duplicates from an unsorted linked list
Example:
Input Linked List : 1->2->2->4->3->3->2 Output : 1->2->4->3
Input: An unsorted linked list
Output: Linked list with no duplicates.
Approach:
- Create a Hash Map
- Take two pointers, prevNode and CurrNode.
- PrevNode will point to the head of the linked list and currNode will point to the head.next.