remove duplication from sorted array