Small and precise cpp


#1

Comment body goes here.int Solution::solve(vector<vector > &A) {
map<int,int>mp;
int c=0,max1=-1;
for(int i=0;i<A.size();i++){
mp[A[i][0]]++;
mp[A[i][1]]–;
}
for(auto it:mp){
c=c+it.second;
max1=max(c,max1);
}
return max1;
}


#2

hey can you explain the code plz


#3

Basically the code is checking maximum number of collisions at any given time. That many number of rooms are needed. It is using offline query update.


#4

should it be mp[A[i][1]+1]– ?