@@ -139,6 +139,7 @@ else if (noOfSpaceStations == 1) {
139
139
// If first city is not a space station
140
140
if (spaceStations [0 ] != 0 ) {
141
141
maxDistance = spaceStations [0 ];
142
+
142
143
} else if ( spaceStations [0 ] == 0 ) {
143
144
maxDistance = (spaceStations [1 ]-spaceStations [0 ])/2 ;
144
145
}
@@ -165,6 +166,7 @@ else if (noOfSpaceStations == 1) {
165
166
/**
166
167
* The space stations are consecutive last,
167
168
* i.e. They are the last ones.
169
+ *
168
170
* Given 5 cities with 2 space stations that
169
171
* are in the end. i.e. Cities 3 and 4 are
170
172
* the space stations.
@@ -175,8 +177,7 @@ else if (noOfSpaceStations == 1) {
175
177
*
176
178
* Get the first station spaceStations[0]
177
179
*
178
- * How to confirm that space stations are
179
- * consecutive last?
180
+ * Confirm that space stations are consecutive last
180
181
*
181
182
*/
182
183
public static boolean areSpaceStationsConsecutiveLast (
@@ -190,10 +191,10 @@ public static boolean areSpaceStationsConsecutiveLast(
190
191
return false ;
191
192
192
193
int firstSpaceStation = spaceStations [0 ];
193
- int isLast = (lastSpaceStation - firstSpaceStation ) -
194
+ int consecutiveLast = (lastSpaceStation - firstSpaceStation ) -
194
195
(numberOfSpaceStations - 1 );
195
196
196
- return ( isLast == 0 ) ? true : false ;
197
+ return ( consecutiveLast == 0 ) ? true : false ;
197
198
}
198
199
}
199
200
0 commit comments