find dup in size n array with 0 to n-2