You are viewing a single comment's thread. Return to all comments →
def flatlandSpaceStations(n, c): c.sort() distances = [] # first distances.append(c[0]) # pair for i, city_with_space_station_idx in enumerate(c): if i==len(c)-1: break next_city_idx = c[i+1] diff = next_city_idx - city_with_space_station_idx - 1 distances.append(math.ceil(diff/2)) # last distances.append(n-c[-1]-1) return max(distances)
Seems like cookies are disabled on this browser, please enable them to open this website
Flatland Space Stations
You are viewing a single comment's thread. Return to all comments →