add the solution of remove duplicates from sort linked list and refactor code