C++ | DP | LIS
\nclass Solution {\npublic:\n    int maxEnvelopes(vector<vector<int>>& envelopes) {\n        if (envelopes.empty()) return 0;\n        sort(envelopes.begin(), e
```\nclass Solution {\npublic:\n    int maxEnvelopes(vector<vector<int>>& envelopes) {\n        if (envelopes.empty()) return 0;\n        sort(envelopes.begin(), envelopes.end());\n        vector<int> dp(envelopes.size(), 1);\n        for (int i = 0; i < envelopes.size(); ++i)\n            for (int j = 0; j < i; ++j)\n                if (envelopes[j][0] < envelopes[i][0] && envelopes[j][1] < envelopes[i][1])\n                    dp[i]  = max(dp[i] , dp[j] + 1);\n        return *max_element(dp.begin(), dp.end());\n    }\n};\n```
['Dynamic Programming', 'C']