java easy to understand | dynamic programming | longest increasing sub sequence
\n\nclass Solution {\n    public int maxEnvelopes(int[][] envelopes) {\n        \n        int omax = 0;\n        Arrays.sort(envelopes,(a,b)->(a[0]-b[0]));\n   
```\n\nclass Solution {\n    public int maxEnvelopes(int[][] envelopes) {\n        \n        int omax = 0;\n        Arrays.sort(envelopes,(a,b)->(a[0]-b[0]));\n        int[] dp = new int[envelopes.length];\n        for(int i=0;i<envelopes.length;i++)\n        {\n            dp[i] = 1; \n            for(int j=0;j<i;j++)\n            {\n                if(envelopes[i][0] > envelopes[j][0] && envelopes[i][1] > envelopes[j][1])\n                {\n                    dp[i] = Math.max(dp[i],1+dp[j]);\n                }\n            }\n            omax = Math.max(omax,dp[i]);\n        }\n        \n        \n        return omax;\n    }\n}\n```\nPlease upvote if u find my code easy to understand
['Dynamic Programming', 'Java']