You are viewing a single comment's thread. Return to all comments →
Java Solution
static int flatlandSpaceStations(int n, int[] c) { Arrays.sort(c); int max = Math.max(c[0], n - 1 - c[c.length - 1]); for (int i = 1; i < c.length; i++) { max = Math.max(max, (c[i] - c[i - 1]) / 2); } return max; }
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 →
Java Solution