Remove duplicates from sorted list|2nd version