• + 1 comment

    Managed to write this in python, it works but is not optimised:

    def flatlandSpaceStations(n, c):
        max_distance = 0
    
        for i in range(n):
            new_dist = []
            for j in c:
                new_dist.append(abs(i - j))
            max_distance = max(min(new_dist), max_distance)
    
        return max_distance