this is my code for the problem ., it gives me a runtime error.
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;cin>>t;
while(t--){
int n; cin>>n;
int k=0;
int arrival[25]={0};
int departure[25]={0};
for(int i=0;i<n;i++){
cin>>k;
arrival[k]++;
}
for(int i=0;i<n;i++){
cin>>k;
departure[k]++;
}
int maxGuests=0,guests=0;
for(int time=0;time<25;time++){
guests=guests-departure[time]+arrival[time];
maxGuests=max(maxGuests,guests);
}
cout<<maxGuests<<endl;
}
return 0;
}
please tell my mistake.