diff options
Diffstat (limited to 'HackerRank/CountingSort1/CountingSort1.cpp')
| -rw-r--r-- | HackerRank/CountingSort1/CountingSort1.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/HackerRank/CountingSort1/CountingSort1.cpp b/HackerRank/CountingSort1/CountingSort1.cpp new file mode 100644 index 0000000..20b476a --- /dev/null +++ b/HackerRank/CountingSort1/CountingSort1.cpp @@ -0,0 +1,19 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main() { + int n, x; + cin >> n; + vector<int> v; + vector<int> freq(100); + for(int i = 0; i < n; i ++){ + cin >> x; + freq[x]+=1; + } + for(auto m : freq){ + cout << m << " "; + } + cout << endl; + return 0; +} |
