C++ solutions || easy to solve
\nclass Solution {\npublic:\n    static bool compare(vector<int>&a , vector<int>& b)\n    {\n      return a[0]==b[0]?a[1]>b[1]:a[0]<b[0];\n    }\n    int maxEnv
```\nclass Solution {\npublic:\n    static bool compare(vector<int>&a , vector<int>& b)\n    {\n      return a[0]==b[0]?a[1]>b[1]:a[0]<b[0];\n    }\n    int maxEnvelopes(vector<vector<int>>&a) {\n      sort(a.begin(),a.end(),compare);\n      vector<int>dp;\n      for(auto i:a)\n      {\n        auto it=lower_bound(dp.begin(),dp.end(),i[1]);\n        if(it==dp.end())\n          dp.push_back(i[1]);\n        else\n          *it=i[1];\n      }\n      return dp.size();\n    }\n};\n```
['C', 'C++']