Binary Search Coding Challenges
Apply binary search efficiently: finding bounds, minimizing/maximizing values, and handling edge cases by solving Binary Search coding challenges.
Problems (15 total)
Festival Drone Altitude Limit
Find the highest altitude at which the drone signal remains stable.
Lantern Stage Volume Check
Determine which stage first hits or exceeds the requested cumulative volume.
Pier Ticket Window Time
Find the minimum time needed for ticket windows to serve all festival guests.
Harbor Relay Coverage Radius
Find the smallest lantern radius that covers every pier checkpoint.
Marina Beacon Frequency Search
Find the lowest beacon frequency that meets or exceeds the patrol request.
Minimize Maximum Distance Between Gas Stations
Given an array representing positions of existing gas stations along a highway and an integer k, add k more stations so that the maximum distance between adjacent stations is minimized. Return that minimum possible maximum distance.
Ceiling Position (First ≥ Target)
Given a sorted array of integers and a target value, return the index of the first element that is greater than or equal to the target. If no such element exists, return -1.
Minimum Prefix Index Reaching Target
Given a list of positive integers and a target value, return the smallest index where the running total is at least the target. If no such index exists, return -1.
Closest Value Index
Given a sorted array of integers and a target value, return the index of the element whose value is closest to the target. If two values are equally close, return the smaller index. If the array is empty, return -1.
Last Value Not Exceeding Target
Given a sorted array of integers and a target value, return the index of the last element that is less than or equal to the target. If every element is greater than the target, return -1.
Count of Elements Less Than Target
Given a sorted array of integers and a target value, return how many elements are strictly less than the target.
Find Target Range
Given a sorted array of integers and a target value, return the starting and ending positions of the target value. If the target is not found, return [-1, -1].
