Given an array of n integers. Find the first element that occurs k number of times. If no element occurs k times, print -1.
The first line contains numbers n and k (n, k ≤ 10^5
). Second line contains n integers, each no more than 10^9
by absolute value.
Print the first element that occurs k times. If no element occurs k times, print -1.