OP solution by CRAZYCAT


#1

int Solution::solve(vector<vector > &A) {
map<int,pair<int,int>>mp;
for(int i=0;i<A.size();i++)
{
mp[A[i][0]].first++;
mp[A[i][1]].second++;
}
int ans=0,rooms=0;
for(auto it:mp)
{
rooms=rooms-it.second.second;
rooms=rooms+it.second.first;
ans=max(ans,rooms);
}
return ans;
}
//comment if you like the solution


#2
int Solution::solve(vector<vector<int> > &A) {

map<int,int> mp;

for(auto v:A){
    mp[v[0]]++;
    mp[v[1]]--;
}
int sum=0,cnt=0;
for(auto x:mp){
    sum += x.second;
    cnt = max(cnt,sum);
}
return cnt;

}

better optmized than yours


#3

So you wanna fight bro😼
Fine come to IIT Guwahati :stuck_out_tongue_closed_eyes:


#4

u don’t know bro about corona
come to haryana :stuck_out_tongue_winking_eye: