Accepted C# (Sort + LIS) solution: Easy to understand
\npublic class Solution {\n    public int MaxEnvelopes(int[][] envelopes)\n    {\n        if (envelopes == null || envelopes.Length == 0)\n            return 0;
```\npublic class Solution {\n    public int MaxEnvelopes(int[][] envelopes)\n    {\n        if (envelopes == null || envelopes.Length == 0)\n            return 0;\n        \n        Array.Sort(envelopes, (a, b) => a[0] == b[0] ? b[1].CompareTo(a[1]) : a[0].CompareTo(b[0]));\n        return LengthOfLIS(envelopes.Select(x => x[1]).ToArray());\n    }\n    \n    public int LengthOfLIS(int[] nums)\n    {\n        int[] dp = new int[nums.Length];\n        int len = 0;\n        foreach (int n in nums)\n        {\n            int i = Array.BinarySearch(dp, 0, len, n);\n            if (i < 0)\n                i = -(i + 1);\n            \n            dp[i] = n;\n            if (i == len)\n                len++;\n        }\n        \n        return len;\n    }    \n}\n```
[]