[Python] Simple DP NlogN solution
\nclass Solution:\n    def maxEnvelopes(self, envelopes: List[List[int]]) -> int:\n        ## RC ##\n        ## APPROACH : DP ##\n        ## Similar to Leetcode
```\nclass Solution:\n    def maxEnvelopes(self, envelopes: List[List[int]]) -> int:\n        ## RC ##\n        ## APPROACH : DP ##\n        ## Similar to Leetcode : 300 Longest Increasing Subsequence ##\n        \n\t\t## TIME COMPLEXITY : O(NlogN) ##\n\t\t## SPACE COMPLEXITY : O(N) ##\n\n        ## LIS : replace larger number with small one, append larger numbers ##\n        ## NUMS  [100, 89, 53, 68, 45, 81] ##\n        ## DP ##\n        # [100]\n        # [89]\n        # [53]\n        # [53, 68]\n        # [45, 68]\n        # [45, 68, 81]\n        \n        def lis(nums):\n            # print(nums)\n            dp = []\n            for i in range(len(nums)):\n                idx = bisect_left(dp, nums[i])\n                if idx == len(dp):\n                    dp.append(nums[i])\n                else:\n                    dp[idx] = nums[i]\n                # print(dp)\n            return len(dp)\n        \n        # sort increasing in first dimension and decreasing on second\n        # take a moment and think why ? ( we want to perform LIS on second dimension, think in terms when a set of boxes have same first dimension)\n        envelopes.sort(key=lambda x: (x[0], -x[1]))\n        \n        # extract the second dimension and run the LIS\n        return lis([envelope[1] for envelope in envelopes])     \n```
['Python', 'Python3']