solution: remove duplicates from sorted list 3