reverse remove duplicates from sorted array.