dsa1 min read
Russian Doll Envelopes — Sort + LIS Binary Search
Find the maximum number of nested envelopes by sorting by width ascending then height descending, then applying LIS.
Read →
1575 articles
Find the maximum number of nested envelopes by sorting by width ascending then height descending, then applying LIS.
Minimize the maximum value after performing k operations (average adjacent elements) using binary search on the answer.
Find the maximum length to cut k ribbons from given ribbons using binary search on the ribbon length.
Maximize nums[index] given array length n, sum constraint maxSum, and each element >= 1 using binary search on the peak value.
Find the kth missing number in a sorted array by binary searching on the number of missing elements up to each index.