Remove duplicate elements from linked list problem solved