Https://leetcode.com/problems/relative-sort-array/

Can anyone help me out with the error in my solution
My code is:-
/******************************************************************************

                          Online C++ Compiler.
           Code, Compile, Run and Debug C++ program online.

Write your code in this editor and press “Run” button to compile and execute it.

*******************************************************************************/

#include<bits/stdc++.h>

using namespace std;

int main()
{
vector arr1={2,3,1,3,2,4,6,7,9,2,19};
vectorarr2={2,1,4,3,9,6};
int b[1005]={};
int n1=arr1.size(),n2=arr2.size();
for(int i=0;i<n1;i++){
b[arr1[i]]++;
}
int t=0;
for(int j=0;j<n2;j++){
while(b[arr2[j]]>0){
arr1[t++]=arr2[j];
b[arr2[j]]–;
}
}
for(int k=0;k<1000;k++){
for(int l=t;l<n1;l++){
while(b[k]>0){
arr1[l++]=k;
b[k]–;
}
}
}
for(auto x:arr1){
cout<<x<<",";
}

return 0;

}