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
1276 articles
Find the length of LIS in O(n log n) using patience sorting: binary search to maintain a sorted tails array.
Minimize the largest subarray sum when splitting into k parts using binary search on the possible answer range.
Search in a rotated sorted array that may contain duplicates by skipping lo++ when mid equals both boundaries.
Find the minimum day to make m bouquets of k adjacent flowers using binary search on the day value.
Find h-index from a sorted citations array in O(log n) using left-boundary binary search.