Given a list of integers, an resonance number is the one with a frequency in the array equal to its value.
Find out the biggest resonance number in the list. If not found, return 0.
Sample Input:
[1,2,3,2,3,4,3,4,5]
Sample Output:
3
数据结构和算法:初级练习题 #52 – 共振数字
给定一个数组,如果里面有数字出现的频率和它的数值相等,那么它就是一个共振数字。找出数组中所有的共振数字中最大的一个。
输入样例:
[1,2,3,2,3,4,3,4,5]
输出样例:
3