Given an array find number such that the value of a number equals the number of times it occurs. Given a String find the character which occurs two times.