remove duplicates from sorted array II

528ms
580ms