You are viewing a single comment's thread. Return to all comments →
C++
int flatlandSpaceStations(int n, vector<int> c) { if(n==c.size()){return 0;} int r=0; for(int i=0;i<n;i++) { int t = 99999999,d; for(int j=0;j<c.size();j++) { d=i-c[j]<0?(i-c[j])*-1:i-c[j]; t=t>d?d:t; } r=t>r?t:r; } return r; }
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 →
C++