本文内容来自刘江的博客教程、LeetCode官网、
一、二分查找
class Solution: def findRadius(self, houses: List[int], heaters: List[int]): n=len(heaters) heaters.sort() a=b=0 for house in houses: j=bisect.bisect_right(heaters,house) i=j-1 right_min=heaters[j]-house if j<n else float('inf') left_min=house-heaters[i] if i>=0 else float('inf') a=min(right_min,left_min) #一个房屋所需供暖器的最小加热半径 b=max(a,b) #所有房屋需要的供暖器的最小加热半径中的最大值,也