I want to get the information of how many times each number has repeated in array. I was doing something like this:
for (int j = 0; j < n; j++){
cin >> x;
arr[x]++;
}
Then I realized the given number may be large as "521659942". And obviously I can't create an array with that size.
arr[x]++;
This is not valid. So what should I do to learn prevalance of each number?