Solved problem 2.1: remove duplicates in linkedlist