Untitled
unknown
c_cpp
2 years ago
319 B
1
Indexable
Never
void frequencyCount(vector<int>& arr,int n, int p) { // code here unordered_map<int,int> map; for (int i=0; i<n; i++) map[arr[i]]++; for (int i=1; i<=p; i++){ if (map.count(i)>0) cout << map[i] << " "; else cout << 0 << " "; } }