Easy to understand || Sorting technique || LIS || D.P
class Solution {\npublic:\n\n    int maxEnvelopes(vector>& envelopes) {\n        \n        int n = envelopes.size();\n        if(n==0)\n            return 0;\n 
class Solution {\npublic:\n\n    int maxEnvelopes(vector<vector<int>>& envelopes) {\n        \n        int n = envelopes.size();\n        if(n==0)\n            return 0;\n        \n        sort(envelopes.begin(),envelopes.end());\n        vector<int> dp(n+1,1);\n        int max = 1;\n        for(int i=1;i<n;++i)\n        {\n            for(int j=0;j<i;++j)\n            {\n                if(envelopes[i][0]>envelopes[j][0]\n                   && envelopes[i][1]>envelopes[j][1]\n                   && 1+dp[j]>dp[i])\n                    dp[i] = 1 + dp[j];\n                if(max<dp[i])\n                    max = dp[i];\n            }\n        }\n        return max;\n    }\n};
['Dynamic Programming', 'C', 'Sorting']