Remove duplicates in sorted array