You are viewing a single comment's thread. Return to all comments →
JavaScript Solution
function flatlandSpaceStations(n, c) { let max = 0; for (let i = 0; i < n; i++){ let dist = c.map(city => Math.abs(city - i)); let min = Math.min(...dist) max = Math.max(max, min); } 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 →
JavaScript Solution