Python, Clean LIS
Idea \nThe idea is to apply LIS algorithm, please solve question 300 first, if you are unfamiliar with it, because this problem adds a level of complexity to th
# Idea \nThe idea is to apply LIS algorithm, please solve question 300 first, if you are unfamiliar with it, because this problem adds a level of complexity to that problem. The key idea here is to make sure to sort the elements in ascending order by the first element and descending order by the second element.\n```\ndef maxEnvelopes(self, envelopes):\n\ttails = []\n\tfor _, b in sorted(envelopes, key = lambda x: (x[0], -x[1])): \n\t\tidx = bisect.bisect_left(tails, b)\n\t\ttails[idx:idx+1] = [b]\n\treturn len(tails)\n```
['Python', 'Python3']