Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int solution(vector<int> &B) {
- B.push_back(1);
- B.push_back(3);
- B.push_back(6);
- B.push_back(4);
- B.push_back(1);
- int max=0,min=0,index;
- for(int i=0;i<B.size();i++)
- {
- if(B[i] > max) max = B[i];
- }
- int tab[max+1];
- for(int i=1;i<max+1;i++)
- {
- tab[i] = 0;
- }
- for(int j=1;j<max+1;j++)
- cout << tab[j];
- for(int k=1;k<max+1;k++)
- {
- index = B[k];
- tab[index]++;
- }
- int temp=1;
- while(tab[temp]!=0)
- {
- cout << tab[temp];
- temp++;
- }
- }
- int main() {
- vector<int> B;
- solution(B);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement