Solution1 DP + Sort

Time complexity: O(n^2)

先按照 w 排序,把问题转化成找 h 的最长上升子序列的问题。

Last updated