remove dup

not just return the length, but also remove in the array.