Heaters

Medium · Binary Search · about 20 minutes

Asked at Google, Amazon, Microsoft, Adobe, Bloomberg, Electronic Arts, Autodesk.

Houses and heaters are on a horizontal line at the given positions. Every heater warms houses within the same radius. Return the minimum radius so that every house is warmed by at least one heater.

Related guides