Ab maza aayega na bhidu

interview-questions
Tags: #<Tag:0x00007f18167c5c10>

#1
bool pmj(const vector<int>&a,const vector<int>&b){
    //ab maza aayega na bhidu
    return a[1]<b[1];
}
int Solution::solve(vector<vector<int> > &A) {
    sort(A.begin(),A.end(),pmj);
    int count=1,j=0;
    for(int i=1;i<A.size();i++){
        if(A[j][1]<A[i][0]){
            count++;j=i;
        }
    }
    return count;
}

#2
Belanchi nagin nighali ...hoye hoye
Nagoba dolayla lagla ... hoye hoye