Microsoft Phone

Anonymous User
3429
Feb 01, 2022
Feb 01, 2022

Microsoft Phone interview:

Given the positions of houses and routers on a horizontal line, return the minimum radius of the routers such that all houses have wifi.
All routers have the same radius.

Example 1:
Input: houses=[1,2,3], routers=[2]
Outpu: 1

Example 2:
Input: houses=[1,2,3,4], routers=[1,4]
Output: 1

Example3:
Input: houses=[1,5], routers=[2]
Output: 3
Comments (4)