Assign True to cities containing station
for city in station : NEW_LINE INDENT hasStation [ city ] = True NEW_LINE DEDENT dist , maxDist = 0 , min ( station ) NEW_LINE for city in range ( numOfCities ) : NEW_LINE INDENT if hasStation [ city ] == True : NEW_LINE INDENT maxDist = max ( ( dist + 1 ) // 2 , maxDist ) NEW_LINE dist = 0 NEW_LINE DEDENT else : NEW_LINE INDENT dist += 1 NEW_LINE DEDENT DEDENT return max ( maxDist , dist ) NEW_LINE