solution to deleteDuplicates (sorted list ii)