Determines whether key appears exactly once in the array a.