You are viewing a single comment's thread. Return to all comments →
golang
func flatlandSpaceStations(n int32, c []int32) int32 { var farthest int32 = 0 for i := int32(0) ; i < n; i++ { var closest int32 = n for j := 0; j < len(c); j++ { distance := abs(i-c[j]) closest = min(closest, distance) } farthest = max(farthest, closest) } return farthest }
Flatland Space Stations
You are viewing a single comment's thread. Return to all comments →
golang