dsa1 min read
Missing Element in Sorted Array — Binary Search on Missing Count
Find the kth missing number in a sorted array by binary searching on the number of missing elements up to each index.
Read →
webcoderspeed.com
1276 articles
Find the kth missing number in a sorted array by binary searching on the number of missing elements up to each index.
Search a row-column sorted 2D matrix in O(m+n) using the staircase technique from top-right corner.
Place c cows in stalls to maximize the minimum distance between any two cows using binary search on the answer.
Count subarrays with sum in [lower, upper] using merge sort on prefix sums for O(n log n) complexity.
Find the picked number using binary search with the guess() API that returns -1, 0, or 1.