first unique element in a given array using a hash