add remove duplicates from sorted array
bug fixed