Learner_Ash
BAN USER
- 0of 0 votes
Answers/* The objective of this exercise is to build a road network connecting every pair of cities.
- Learner_Ash in United States
Each city should be connected to each other city once.
*/
public class Program
{
/* Your function RoadBuilder should return a list of new roads required to be built,
if the existing roads are given by builtRoads and the total number of
cities is nCities. Roads should not connect cities to themselves.
*/
public static int[][] RoadBuilder(int nCities, int[, ] builtRoads)
{
//implement the function here
return new int[0][];
}
public static void Main()
{
int[, ] test1 = new int[3, 2]{{0, 1}, {1, 2}, {3, 2}};
Console.WriteLine(RoadBuilder(4, test1)); // expected result should be {{0,2}, {0, 3}, {1, 3}}
}
}| Report Duplicate | Flag | PURGE
Program Manager - 0of 0 votes
Answers/* The objective of this exercise is to build a road network connecting every pair of cities.
- Learner_Ash in United States
Each city should be connected to each other city once.
*/
public class Program
{
/* Your function RoadBuilder should return a list of new roads required to be built,
if the existing roads are given by builtRoads and the total number of
cities is nCities. Roads should not connect cities to themselves.
*/
public static int[][] RoadBuilder(int nCities, int[, ] builtRoads)
{
//implement the function here
return new int[0][];
}
public static void Main()
{
int[, ] test1 = new int[3, 2]{{0, 1}, {1, 2}, {3, 2}};
Console.WriteLine(RoadBuilder(4, test1)); // expected result should be {{0,2}, {0, 3}, {1, 3}}
}
}| Report Duplicate | Flag | PURGE
Applications Developer Algorithm
@zlpmichelle Any data structure can be used.
- Learner_Ash January 12, 2017King@Work : could you please help know what specific in 0-based indices in problem