You are viewing a single comment's thread. Return to all comments →
def flatlandSpaceStations(n, c): c.sort() end_max = max(c[0], n-1-c[-1]) in_max = max(c[i]-c[i-1] for i in range(1, len(c))) if len(c)!=1 else 0 return max(end_max, in_max//2)
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 →
def flatlandSpaceStations(n, c): c.sort() end_max = max(c[0], n-1-c[-1]) in_max = max(c[i]-c[i-1] for i in range(1, len(c))) if len(c)!=1 else 0 return max(end_max, in_max//2)