solution for remove duplicates from sorted list