Russian Doll Envelopes || simple c++ solution || dynamic programming
Simple C++ solution \nUsing dynamic programming\n\n\n   int maxEnvelopes(vector<vector<int>>& envelopes) {\n        \n  sort(envelopes.begin(), envelopes.end(),
Simple C++ solution \nUsing dynamic programming\n\n``` \n   int maxEnvelopes(vector<vector<int>>& envelopes) {\n        \n  sort(envelopes.begin(), envelopes.end(), [](vector<int>& a, vector<int>& b) \n             -> bool {return a[0] == b[0] ? b[1] < a[1] : a[0] < b[0];});\n        vector<int> dp;\n        for (auto& env : envelopes) {\n            int height = env[1];\n            int left = lower_bound(dp.begin(), dp.end(), height) - dp.begin();\n            \n            if (left == dp.size()) dp.push_back(height);\n            dp[left] = height;\n        }\n        return dp.size();\n    }\n\t\n\t```
['Dynamic Programming', 'C']