dsa1 min read
Longest Increasing Subsequence — Patience Sort Binary Search
Find the length of LIS in O(n log n) using patience sorting: binary search to maintain a sorted tails array.
Read →
webcoderspeed.com
2 articles
Find the length of LIS in O(n log n) using patience sorting: binary search to maintain a sorted tails array.
Find the maximum number of nested envelopes by sorting by width ascending then height descending, then applying LIS.