What is the error in this code

#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t–){
vector< pair <int, int> > v;
int l,m,n;
cin>>l;
int cnt=1;
for(int i=0;i<l;i++){
cin>>m>>n;
v.push_back(make_pair(m,n));
}
sort(v.begin(), v.end());
for(int i=1;i<l;i++){
int j=0;
if(v[i].first>=v[j].second){
cnt++;
j=i;
}
}
cout<<cnt<<endl;;
}

}

hello @Detoxo_16
sort ur array on the basis of v[i].first+v[i].second

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.