I'm using #include <bits/stdc++.h> using namespace std; and so the sort() function would be nlogn.
for(int i=0;i<n;i++){
statement;
}
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
statement;
}
}
sort(arr,arr+n);
sort(arr2,arr2+n);
for(int i=0;i<n;i++){
statement;
}
I'm not sure if the total time complexity is O((m * n)+nlogn+2n) or O((m * n)+2(nlogn)+2n)..