first repeating element in array