remove the duplicates from an unsorted linked list
class ListNode for chapter 2