Search for the answer in a range of possible values.
Pattern: If checking validity is and validity is monotonic, binary search finds optimal in .
Example: Minimum speed to finish trip in hours.
- Answer in .
- Check if speed finishes in hours.
- Higher speeds valid if lower are. Monotonic.
Binary search on speed, check feasibility at midpoint.