You are viewing a single comment's thread. Return to all comments →
function flatlandSpaceStations($n, $m, $c) { sort($c); $max = $c[0]; for($i = 0; $i < $m - 1; $i++) { $dist = floor(($c[$i + 1] - $c[$i]) / 2); if($dist > $max) { $max = $dist; } } $max = max($max, $n - 1 - $c[$m - 1]); 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 →