354. Russian Doll Envelopes

idea - sort w by asc first, but when w are the same, h do sort by desc, the focus on h find the LIS (leetcode 300)
when widths are the same, why height should do sort by desc?

sort + DP + binary search
Previous300. Longest Increasing Subsequence (LIS)Next1964. Find the Longest Valid Obstacle Course at Each Position
Last updated