You are viewing a single comment's thread. Return to all comments →
const flatlandSpaceStations = (n,c) => { let maxDistanceList = []; for(let city=0;city<n;city++) { let spaceStationDistance = c.map((spaceStation) => Math.abs(city - spaceStation)); maxDistanceList.push(Math.min(...spaceStationDistance)); } return Math.max(...maxDistanceList); }
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 →