Koko Eating Bananas — Binary Search on Answer (Speed)
Find the minimum eating speed for Koko to finish all bananas in h hours using binary search on the answer space.
webcoderspeed.com
12 articles
Find the minimum eating speed for Koko to finish all bananas in h hours using binary search on the answer space.
Find the minimum ship capacity to ship all packages within d days using binary search on capacity.
Minimize the largest subarray sum when splitting into k parts using binary search on the possible answer range.
Find the minimum day to make m bouquets of k adjacent flowers using binary search on the day value.
Find the kth smallest element in a row-column sorted matrix by binary searching on the value range.
Maximize the minimum distance between m balls in baskets using binary search on the answer (minimum distance).
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.
Place c cows in stalls to maximize the minimum distance between any two cows using binary search on the answer.
Find the kth smallest prime fraction from an array using binary search on the fraction value with a counting function.
Find the minimum train speed to arrive on time given n rides (last ride doesn't wait) using binary search on speed.