from bisect import bisect

class Solution:
    # n = len(houses), m = len(heathers)
    # O(m log m + n log m) = O(max(mlogm, nlogm)) time - O(1) space
    def get_heathers_radius(self, houses, heathers):
        heathers = [float('-inf')] + sorted(heathers) + [float('inf')]
        result = 0
        for house in houses:
            i = bisect(heathers, house)
            min_distance = min(house - heathers[i-1], heathers[i] - house)
            result = max(result, min_distance)
        
        return result

houses = [1, 2, 3, 4]
heathers = [2]
solution = Solution()
print(solution.get_heathers_radius(houses, heathers))