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)

Show:

Festival Drone Altitude Limit

Find the highest altitude at which the drone signal remains stable.

Solve

Lantern Stage Volume Check

Determine which stage first hits or exceeds the requested cumulative volume.

Solve

Pier Ticket Window Time

Find the minimum time needed for ticket windows to serve all festival guests.

Solve

Harbor Relay Coverage Radius

Find the smallest lantern radius that covers every pier checkpoint.

Solve

Marina Beacon Frequency Search

Find the lowest beacon frequency that meets or exceeds the patrol request.

Solve

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.

Solve

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.

Solve

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.

Solve

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.

Solve

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.

Solve

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.

Solve

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].

Solve
Showing 1 - 12 of 15 problems
1