int maxOccured(int L[], int R[], int n, int maxx){
// int v[maxx]={0};
vector<int> v(maxx);
for(int i=0; i<n; i++){
v[L[i]]+=1;
v[R[i]+1]-=1;
}
int max=v[0];
int res=0;
for(int i=1; i<maxx; i++){
v[i]+=v[i-1];
if(v[i]>max){
max=v[i];
res=i;
}
}
return res;
}
here in my code if I am using an array of same size it is working fine but while using a vector I am getting an error of
Abort signal from abort(3) (SIGABRT)
Here are few things you should be absolutely sure of: