Remove duplicates from an unsorted linked list
Submissions: 11080   Accuracy:

49.19%

  Difficulty: Easy
     

Remove duplicate element from an unsorted Linked List ..

Input:
You have to complete the method which takes 1 argument: the head of the  linked list  .You should not read any input from stdin/console. There are multiple test cases. For each test case, this method will be called individually.

Output:
Your function should return a pointer to a linked list with no duplicate element.

Constraints:
1 <=T<= 100
1 <= size of linked lists <= 50

Note: If you use "Test" or "Expected Output Button" use below example format.

Example:
Input
2
4
5 2 2 4
5
2 2 2 2 2

Output
5 2 4
2

 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Amit Khandelwal
Author: Shubham Joshi 1


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.